Open DunaMariusCosmin opened 2 years ago
So the suggestion is that
# Title
<h1 id="newTitle">New Title</h1>
Content
is treated as
# Title
# New Title {#newTitle}
Content
and would be converted to
<dita>
<topic id="title">
<title>Title</title>
</topic>
<topic id="newTitle">
<title>New Title</title>
<body>Content</body>
</topic>
</dita>
It's a good fallback, but might cause confusion.
The implementation would need to first convert HTML headers into AST, because counting header jumps and whether <dita>
wrapper is needed is done by reading the AST.
I wouldn't recommend supporting this. Markdown doesn't like multiple H1 headers in a single file (re: MD025)
If you want to separate your topic and your first header, consider using a YAML title instead. https://github.com/jelovirt/org.lwdita/wiki/Common-syntax#metadata
I have the following makdown document:
The HTML
<h1>
element is converted into a DITA<title>
element and the resulted document is invalid. I think it should be handled like markdown headings and a new topic should be created when it's converted to DITA.