Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlighting of footnote text breaks if comma is present #15

Open
hijarian opened this issue May 24, 2015 · 5 comments
Open

Highlighting of footnote text breaks if comma is present #15

hijarian opened this issue May 24, 2015 · 5 comments

Comments

@hijarian
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

  • that the footnote's text can contain elements such as inline macros (the http link in your example) or (un)constrained quotes.
  • that http(s)/ftp/irc/... inline macros can also contain commas

@sensorflo
Copy link
Owner

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

@nicorikken
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants