Open iacore opened 9 months ago
I was able to reproduce, i.e. I noticed the lack of a space and the :p
tag behavior doesn't seem appropriate.
Fixes would be nice :)
A couple of work-arounds [1]:
Wrap the initial paragraph explicitly, e.g.
@p{@link[https://clojure.org/]{Clojure} contains ...}
Don't start the paragraph with a link, e.g.
The language @link[https://clojure.org/]{Clojure} contains ...
I'm not suggesting that it wouldn't be better for the current behavior to be improved, the above are just interim alternatives that seem to yield improved results. If one is willing to modify one's content, may be one or the other is useful.
[1] Limited testing with either of the work-around via:
(htmlgen/html (get (mdz/markup (slurp "file.mdz")) :markup-dom))
seemed to yield ok results here.
So this is something that has been in mendoza since the beginning and not sure the best way to resolve it - starting a section with a tag is ambiguous in that some tags are "inline" and some tags are block elements. I think the recommended work around of using @p{...}
is the right thing here, but aside from creating complicated parsing rules, I might just leave this as wontfix.
If there's no good way to address this, may be some kind of mention in documentation could be helpful?
complicated parsing rules
I thought of a rule, which states,
Any group of elements with an empty line before and after,
if it's only one element, it's not wrapped in <p>
otherwise, it is wrapped in <p>
@link[]() this is in a paragraph
this is in a paragraph @link[]()
@link[this is not in a paragraph but should be in a paragraph?]()
@codeblock`this is not in a paragraph`
What existing code does this break?
how to reproduce
now, you should see this output
the space between
Clojure
is andcontains
is gone!Also, the :a tag should be inside :p tag, not before it.