diff --git a/.markdownlint.yaml b/.markdownlint.yaml index fc4a8d8..5578937 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -17,6 +17,8 @@ MD033: # no-inline-html - code - details - i + - li - summary - sup - u + - ul diff --git a/knowledge base/markdown.md b/knowledge base/markdown.md index 2b2d226..a8a09ed 100644 --- a/knowledge base/markdown.md +++ b/knowledge base/markdown.md @@ -276,7 +276,33 @@ More advanced control requires using HTML tags directly: Include a non-code formatted backtick by escaping it normally (with a `\`). -Render it in an inline code block using double backticks instead of single backticks. +Render it in an inline code block using _multiple_ backticks instead of single backticks. + +
+ +``` ``List`1`` ``` produces ``List`1``. + +Add a space on _**each**_ side to put one or more backticks at the beginning or the end of the code: + +``` `` foo` `` ``` produces `` foo` ``.
+``` `` `foo `` ``` produces `` `foo ``.
+``` `` ` `` ``` produces `` ` ``. + +Without the encapsulating spaces, or if only one is used, parsing breaks: + +```````` ``foo``` ```````` produces \`\`foo\`\`\`.
+```````` ```foo`` ```````` produces \`\`\`foo\`\`.
+`````` ````` `````` produces `````.
+`````` ``foo` `` `````` produces ``foo` ``.
+`````` `` `foo`` `````` produces `foo``. + +Should the inline code contain longer sequences of backticks, _**enclose**_ it in a backtick sequence that is longer +than anything in the code itself: + +```` ```foo``bar``` ```` produces ```foo``bar```.
+````` ````foo```bar```` ````` produces ````foo```bar````. + +
Alternatively, use a code block. This will wrap everything in a `
` HTML tag.
To do this, either indent 4 spaces to start a code block, or use fenced code blocks if supported. @@ -294,6 +320,7 @@ Install and enable [`bierner.markdown-mermaid`][bierner.markdown-mermaid]'s exte - [Live editor] - [Mermaid.js] - [MyST] extension for technical, scientific communication and publication +- [Markdown: Syntax] ### Sources @@ -306,6 +333,7 @@ Install and enable [`bierner.markdown-mermaid`][bierner.markdown-mermaid]'s exte - [Syntax highlighting in Markdown] - [Writing on GitHub] - [GitLab Flavored Markdown] +- [How do I escape a backtick \` within in-line code in Markdown?]