# Shall CommonMark inline inside HTML5 render as CommonMark? If not, why not?

**URL:** <https://talk.commonmark.org/t/shall-commonmark-inline-inside-html5-render-as-commonmark-if-not-why-not/8964>\
**Category:** Spec\
**Tags:** release-1.0\
**Created:** [September 27, 2025, 12:30pm UTC](https://talk.commonmark.org/t/shall-commonmark-inline-inside-html5-render-as-commonmark-if-not-why-not/8964 "2025-09-27T12:30:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rokejulianlockhart](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/rokejulianlockhart/32/3399_2.png) [@rokejulianlockhart](https://talk.commonmark.org/u/rokejulianlockhart)\
**Post date:** [September 27, 2025, 12:30pm UTC](https://talk.commonmark.org/t/shall-commonmark-inline-inside-html5-render-as-commonmark-if-not-why-not/8964/1 "2025-09-27T12:30:56Z")

</div>

At [`github.com/MALSync/MALSync/issues/2092`](https://github.com/MALSync/MALSync/issues/2092#issue-1950841402):

> <https://github.com/MALSync/MALSync/issues/2092#issue-1950841402>
>
> \### \*\*Website\*\*
> 
> \<table\>\<tr\>
> \<th\> Name \</th\>
> \<td\> \<code\>Bookwyrm.social\</code\>… \</td\>
> \</tr\>\<tr\>
> \<th\> Link \</th\>
> \<td\> \<a href="https://bookwyrm.social/"\>\<code\>https://bookwyrm.social/\</code\>\</a\> \</td\>
> \</tr\>\</table\>
> 	
> \#### \*\*Languages\*\*
> 
> 1.	\[\`eng\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=);
> 
> 1.	\[\`cat\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=);
> 
> 1.	\[\`ger\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=);
> 
> 1.	\[\`epo\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=);
> 
> 1.	\[\`spa\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=);
> 
> 1.	\[\`baq\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=);
> 
> 1.	\[\`glg\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=);
> 
> 1.	\[\`ita\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=);
> 
> 1.	\[\`fin\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=);
> 
> 1.	\[\`fre\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=);
> 
> 1.	\[\`lit\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=);
> 
> 1.	\[\`dut\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=);
> 
> 1.	\[\`nno\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=);
> 
> 1.	\[\`pol\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=);
> 
> 1.	\<code\>\[por\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?iso\_639\_1=pt)\[-\](https://stackoverflow.com/questions/13630355/culture-name-using-underscore-instead-of-dash#comment18695296\_13630355)\[BRA\](https://en.wikipedia.org/wiki/ISO\_3166-1\_alpha-3#:~:text=Plurinational%20State%20of%29-,bra,-Brazil)\</code\>;
> 
> 	
> 
> 1.	\<code\>\[por\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=363)\[-\](https://stackoverflow.com/questions/13630355/culture-name-using-underscore-instead-of-dash#comment18695296\_13630355)\[EEE\](https://en.wikipedia.org/wiki/ISO\_3166-1\_alpha-3#:~:text=ABB%20Asia-,eee,-Europe)\</code\>;
> 
> 1.	\[\`ro\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?iso\_639\_1=ro);
> 
> 1.	\[\`sv\`\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?iso\_639\_1=sv);
> 
> 1.	\<code\>\[zho\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=)\[-\](https://stackoverflow.com/questions/13630355/culture-name-using-underscore-instead-of-dash#comment18695296\_13630355)\[HANS\](https://stackoverflow.com/a/4894634/9731176)\</code\>; and
> 
> 1.	\<code\>\[zho\](https://www.loc.gov/standards/iso639-2/php/langcodes\_name.php?code\_ID=)\[-\](https://stackoverflow.com/questions/13630355/culture-name-using-underscore-instead-of-dash#comment18695296\_13630355)\[HANT\](https://stackoverflow.com/a/4894634/9731176)\</code\>.
> 	
> \### \*\*Other Details\*\*
> 	
> It is the official \[\`github.com/bookwyrm-social/bookwyrm\`\](https://github.com/bookwyrm-social/bookwyrm/blob/98600440d8c2315205616e6bd2effe1aafc667df/README.md#bookwyrm:~:text=BookWyrm%20is%20a%20social%20network%20for%20tracking%20your%20reading%2C%20talking%20about%20books%2C%20writing%20reviews%2C%20and%20discovering%20what%20to%20read%20next) instance.

…via the available “GitHub-Flavoured Markdown” markup syntax, I am able to utilise CommonMark inside a `<code>` tag, directly inline:

```Markdown
1.	<code>[por](https://www.loc.gov/standards/iso639-2/php/langcodes_name.php?iso_639_1=pt)[-](https://stackoverflow.com/questions/13630355/culture-name-using-underscore-instead-of-dash#comment18695296_13630355)[BRA](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#:~:text=Plurinational%20State%20of%29-,bra,-Brazil)</code>;

	<!-- 
	
	[^1]: [`stackoverflow.com/revisions/40076454/2`][1]

	[1]: https://stackoverflow.com/revisions/40076454/2#:~:text=Sometimes%20you%20need%20to%20encode,%5BSyntax%5D(http://en.wikipedia.org/wiki/Syntax_(programming_languages%2529)

	 -->

1.	<code>[por](https://www.loc.gov/standards/iso639-2/php/langcodes_name.php?code_ID=363)[-](https://stackoverflow.com/questions/13630355/culture-name-using-underscore-instead-of-dash#comment18695296_13630355)[EEE](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#:~:text=ABB%20Asia-,eee,-Europe)</code>;

1.	[`ro`](https://www.loc.gov/standards/iso639-2/php/langcodes_name.php?iso_639_1=ro);

1.	[`sv`](https://www.loc.gov/standards/iso639-2/php/langcodes_name.php?iso_639_1=sv);

1.	<code>[zho](https://www.loc.gov/standards/iso639-2/php/langcodes_name.php?code_ID=)[-](https://stackoverflow.com/questions/13630355/culture-name-using-underscore-instead-of-dash#comment18695296_13630355)[HANS](https://stackoverflow.com/a/4894634/9731176)</code>; and

1.	<code>[zho](https://www.loc.gov/standards/iso639-2/php/langcodes_name.php?code_ID=)[-](https://stackoverflow.com/questions/13630355/culture-name-using-underscore-instead-of-dash#comment18695296_13630355)[HANT](https://stackoverflow.com/a/4894634/9731176)</code>.

```

I was under the impression that CommonMark requires a newline between the start and end tags of any HTML5 for the CommonMark within to render, which I still believe to be correct. Please correct me if I’m not. However, with that premise, if this is technically feasible, why is it disallowed by the standard?

---

<div class="post-metadata">

**Author:** ![kivikakk](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/kivikakk/32/3341_2.png) [@kivikakk](https://talk.commonmark.org/u/kivikakk)\
**Post date:** [June 26, 2026, 12:54pm UTC](https://talk.commonmark.org/t/shall-commonmark-inline-inside-html5-render-as-commonmark-if-not-why-not/8964/2 "2026-06-26T12:54:12Z")

</div>

This is an exceptionally late reply from me, but I happened to see this while reading another post and it’s a question that comes up a lot.

The short answer is, it depends: see [§ 6.6 Raw HTML](https://spec.commonmark.org/0.31.2/#raw-html) for how raw HTML is interpreted _inline_; note especially the definition of an HTML tag:

> An [HTML tag](https://spec.commonmark.org/0.31.2/#html-tag) consists of an [open tag](https://spec.commonmark.org/0.31.2/#open-tag), a [closing tag](https://spec.commonmark.org/0.31.2/#closing-tag), an [HTML comment](https://spec.commonmark.org/0.31.2/#html-comment), a [processing instruction](https://spec.commonmark.org/0.31.2/#processing-instruction), a [declaration](https://spec.commonmark.org/0.31.2/#declaration), or a [CDATA section](https://spec.commonmark.org/0.31.2/#cdata-section).

In other words, when it comes to inline HTML, there’s no such thing as “inside” a `<code>` tag: the `<code>` is itself considered an HTML tag, then there’s some Markdown which is parsed as usual, and then `</code>` is also considered one. So in this sense, Markdown “within” what we read as a `<code>`…`</code>` pair is totally fine, because parsers just treat each in isolation as inline HTML.

You can see this in action by [looking at the AST for e.g. the following input](https://spec.commonmark.org/dingus/?text=1.%09%3Ccode%3E%5Bpor%5D(https%3A%2F%2Fwww.loc.gov%2Fstandards%2Fiso639-2%2Fphp%2Flangcodes_name.php%3Fiso_639_1%3Dpt)%5B-%5D(https%3A%2F%2Fstackoverflow.com%2Fquestions%2F13630355%2Fculture-name-using-underscore-instead-of-dash%23comment18695296_13630355)%5BBRA%5D(https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FISO_3166-1_alpha-3%23%3A~%3Atext%3DPlurinational%2520State%2520of%2529-%2Cbra%2C-Brazil)%3C%2Fcode%3E%3B):

```markdown
1. <code>Hello</code> world.

```

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document SYSTEM "CommonMark.dtd">
<document xmlns="http://commonmark.org/xml/1.0">
  <list type="ordered" start="1" tight="true" delimiter="period">
    <item>
      <paragraph>
        <html_inline>&lt;code&gt;</html_inline>
        <text>Hello</text>
        <html_inline>&lt;/code&gt;</html_inline>
        <text> world.</text>
      </paragraph>
    </item>
  </list>
</document>

```

Note each tag is simply `html_inline`.

Things get more complicated when we consider block HTML, per [§ 4.6 HTML blocks](https://spec.commonmark.org/0.31.2/#html-blocks). The 7 start conditions outline in which cases a compliant parser will suspend treating input as Markdown, and when they’ll resume.

Of particular relevance is start condition 6, as it outlines the majority of tags considered to be “block”: a line that starts with e.g. `<table>` will suspend parsing until it reaches a blank line. Thus:

```markdown
<table>
<tr><td> **This won't be emphasised.** </td></tr>
</table>

**This will**

<table><tr><td>

**This will be in a table, *and* will be emphasised.**

</td></tr></table>

```

Note that `<code>` is _not_ part of any start condition, so it is interpreted per inline rules even if it happens to come at the start of a line.
