Why is [can-component/content] in component.md invisible in can-component.html?


#1

In reading can-component.html I noticed the sentence,

Use the tag to position the custom element’s source HTML.

the tag seemed ambiguous here; I decided it must refer to the <content> tag. So I located the source file for this page intending to submit a Pull Request.

Then things got more interesting: line 199 of the source file reads:

Use the [can-component/content] tag to position the custom element’s source HTML.

So the correct text is in place but for some reason doesn’t appear in the compiled document, either here or in other passages in the source file.

However, other similarly formatted references are rendered in the compiled document. For example, on line 64,

can be rendered by a corresponding [can-component/can-slot]

is rendered in the compiled document as

can be rendered by a corresponding <can-slot>

and on line 310,

The [can-component/connectedCallback] function

is rendered as:

The connectedCallback function

I’m guessing there is a missing reference somewhere, or maybe content is a reserved word. Any help appreciated, thanks.


#2

I think there’s a bug in the documentation engine. It needs to escape the actual <content> element. I’ll create an issue.


#3

#4

FYI, findings so far:

  • An example of the desired outcome in the compiled .html version of the document is:

<a href="can-component/can-slot.html" title="Position the content of can-template elements.">&lt;can-slot&gt;</a>

  • This escaped tag appears as follows from the browser:

<can-slot>

  • The current outcome in the compiled .html version of the document for the markdown [can-component/content] is:

<a href="can-component/content.html" title="Positions the LIGHT_DOM within a component’s can-component.prototype.view."><content></content></a>

  • This unescaped tag is invisible from the browser because <content></content> is interpreted as an empty element.

#5

yeah, I noticed that markdown will escape tags like <foo-bar> but not tags like <foo>. This is what caused the bug. I submitted a pull request to fix it last night.