Stream: IG creation
Topic: H3 <a> tag magic
Nick George (Jan 20 2022 at 00:04):
Hello - running into an issue with my index.xml - It seems there's some magic that inserts an <a> tag around <h3> tags, but it's not behaving quite right for me, causing the entire contents of <p> tags after the <h3> tags to be encased in the <a> tag as well. This means all the contents of the section are blue and highlightable. Any idea what could cause that?
Nick George (Jan 20 2022 at 00:06):
Our first h3 tag renders correctly: Screen-Shot-2022-01-19-at-4.05.34-PM.png
but subsequent ones do not:
Screen-Shot-2022-01-19-at-4.06.16-PM.png
John Moehrke (Jan 20 2022 at 00:07):
is your IG source in markdown or xml?
Nick George (Jan 20 2022 at 00:07):
xml
John Moehrke (Jan 20 2022 at 00:08):
could you share your github? more eyes are often helpful.
Nick George (Jan 20 2022 at 00:08):
sorry not public yet (working towards that!)
Nick George (Jan 20 2022 at 00:09):
but would be happy to switch to markdown... is that just a question of replacing html/pagecontents/index.xml with html/pagecontents/index.md?
John Moehrke (Jan 20 2022 at 00:09):
mostly, yes. and using markdown rather than xml
Nick George (Jan 20 2022 at 00:10):
ok, and I don't have to change anything else to tell it to use the index.md rather than index.xml?
Nick George (Jan 20 2022 at 00:10):
I'll try that and see if that works better for the headers
John Moehrke (Jan 20 2022 at 00:10):
not going to say it will fix the problem. but these things tend to be things that hide from the original author, but a second set of eyes sees it. pair-programming
Nick George (Jan 20 2022 at 00:11):
well, it seems to be an issue with some processing that gets done by the publisher on top of the exiting xml
Nick George (Jan 20 2022 at 00:12):
I wonder if there are certain structures of content sections that we're expected to be following to make the renderer happy
Nick George (Jan 20 2022 at 00:13):
hmm seeing Template based HTML file index.html is missing source file index.xml
Lloyd McKenzie (Jan 20 2022 at 02:34):
You shouldn't need to change from using XHTML. I've seen anchor tags inserted if there's a validation error, but those usually use UUIDs, not sequential numbers unless something has changed. And even there, the anchors shouldn't wrap anything. What template is your IG using?
Jose Costa Teixeira (Jan 20 2022 at 06:40):
@Nick George if you have you ig resource as xml or json you should replace the html
with the markdown
in page.generation
"page": {
"nameUrl": "index.html",
"title": "Main Page",
"generation": "html",
"page": {
"nameUrl": "index.html",
"title": "Main Page",
"generation": "markdown",
Jose Costa Teixeira (Jan 20 2022 at 06:47):
as for the tag - why are you adding an <a> tag on the h3 tag? If I understand correctly, the template will create the links around any heading tag from h1 to h6.
Besides, there is an annoying issue where this works well
<a name="summary"> </a>
<h3 id="summary">Summary</h3>
but this messes up the text
<a name="summary"></a>
<h3 id="summary">Summary</h3>
(note the missing space before closing the </a>. If that is not there, the following text will be a hyperlink
Nick George (Jan 20 2022 at 17:16):
@Lloyd McKenzie all out of the-box defaults for templates...fhir.base.template
. Ran through some html sanitizers that seem to be ok with it
Nick George (Jan 20 2022 at 17:16):
@Jose Costa Teixeira I'm not adding an <a> tag, the publisher is
Nick George (Jan 20 2022 at 17:57):
Just to close the loop here - converting to markdown has worked easily and is easier to read in source anyway, so just doing that. Dunno what was going on with the xml version.
Jose Costa Teixeira (Jan 20 2022 at 18:06):
Sorry we did not find the issue - but without looking at the code it's really hard
Nick George (Jan 20 2022 at 18:10):
yeah for sure
Nick George (Jan 20 2022 at 18:10):
thanks for your help!
Lloyd McKenzie (Jan 20 2022 at 20:12):
Actually, it may be that you should list your content as "xml" rather than "html". The former is for XHTML. The latter is for pure html.
Last updated: Apr 12 2022 at 19:14 UTC