From c8207aa7378bb346f1c8ed5679bd0e5057fe3b61 Mon Sep 17 00:00:00 2001 From: Lee Hanken Date: Mon, 2 May 2022 12:29:41 +0100 Subject: [PATCH] handle inline code in apple dev doc --- url_to_markdown_apple_dev_docs.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/url_to_markdown_apple_dev_docs.js b/url_to_markdown_apple_dev_docs.js index de796b3..eadd729 100755 --- a/url_to_markdown_apple_dev_docs.js +++ b/url_to_markdown_apple_dev_docs.js @@ -131,7 +131,11 @@ module.exports = { inline_text += this.dev_references[inline.identifier].title; } } - } + } else if (inline.type == 'codeVoice') { + if (typeof inline.code !== 'undefined') { + inline_text += "`"+inline.code+"`"; + } + } } }); text += inline_text + "\n\n"; @@ -155,7 +159,12 @@ module.exports = { text += n + " " + this.process_content_section(list_item); }); } - } + } else if (content.type == 'heading') { + if (typeof content.level !== 'undefined' && typeof content.text !== 'undefined') { + text += "#".repeat(content.level); + text += " " + content.text + "\n\n"; + } + } } });