On 11/10/2023 16:15, Ihor Radchenko wrote:
Max Nikulin <maniku...@gmail.com> writes:
Isn't nested bold for "**bold**" a bug? Generally it is not allowed and
*b1 *b2* b3*
is parsed as bold only for "b1 *b2".
No, **bold** it is not a bug. The parser is recursive with inner markup
not "seeing" its parent. So, we first parse the outer bold and then
continue parsing the contents separately, as *bold*.
I just find the following rather confusing:
(org-export-string-as "**bold**" 'html t)
"<p>\n<b><b>bold</b></b></p>\n"
(org-export-string-as "**inner* outer*" 'html t)
"<p>\n<b>*inner</b> outer*</p>\n"
(org-export-string-as "*outer *inner**" 'html t)
"<p>\n<b>outer <b>inner</b></b></p>\n"
(org-export-string-as "*begin *inner* end*" 'html t)
"<p>\n<b>begin *inner</b> end*</p>\n"
Be it another way, /*bold italic*/ would also not be allowed as
we demand bol, whitespace, -, (, {, ', or " before the markup:
https://orgmode.org/worg/org-syntax.html#Emphasis_Markers
Certainly /*b*/ should work, but nested bold was a surprise for me. I
believed that nesting is strictly prohibited. The case of underscores is
even more tricky due to ambiguity of underline and subscript.
P.S. Juan Manuel at certain moment discovered that pandoc allows nesting
for *b1 *b2* b3*.