sensorflo / adoc-mode

A major-mode for editing AsciiDoc files in Emacs
https://github.com/sensorflo/adoc-mode/wiki
76 stars 41 forks source link

Highlighting of footnote text breaks if comma is present #15

Open hijarian opened 9 years ago

hijarian commented 9 years ago

Code:

footnote:[Some text, probably containing a comma. Second sentence.]

Inside a footnote text, after a comma font-face returns to normal text mode (not small and in different color anymore). I believe this is because comma is a separator of attributes inside macros, but can we have a special case for footnotes? I often have footnotes a lot larger than single simple sentence, not broken by comma.

sensorflo commented 9 years ago

I can't reproduce that behavior. Neither with the latest greatest adoc-mode version 0.6.4, nor with the older 0.6.0. In all versions, the complete text inside the brackets ([...]) is fontified with the same face, even if it contains commas somewhere. I also tried exactly your example. Which adoc-mode version do you use?

hijarian commented 9 years ago

I would be immensely glad myself if it was fixed already in some version.

Here is the example with Latin characters (of course it's UTF-8, I meant only the script):

http://www.joelonsoftware.com/articles/Unicode.html[The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)] 

link broken typeface

Here is the footnote:

Footnote with comma.footnote:[Yes, that means ASCII can be stored and transferred using only 7 bits and it often is. http://asciidoc.org[Random link, comma again] No, this is not within the scope of this article and for the sake of argument we'll assume the highest bit is "wasted" in ASCII.]

Footnote without a comma.footnote:[Yes]

footnote broken typeface

As far as I understand, reason is simple: if I enclose text inside square brackets into quotes, I'll explicitly denote it as a sole marco argument and the font-lock will work correctly. But this is a pain to use, especially since Asciidoc/Asciidoctor parsers seems to not care about that in footnotes and link text. Can we have some sort of special case for macros having only one argument by design?

sensorflo commented 8 years ago

I just pushed version 0.6.5. It fixes that you can now have commas in the footnote's text. It can now also spawn multiple lines. However your examples are still not fontified correctly. What still is still missing is

sensorflo commented 8 years ago

I now also pushed 0.6.6. Now the http(s)/ftp/irc/... inline macros can also contain commas.

nicorikken commented 8 years ago

Just tried all the above examples on version 0.6.6. and they render correctly. I guess this ticket is fixed 👍