asciidoctor / atom-asciidoc-preview

⚛ AsciiDoc preview for the Atom editor.
https://atom.io/packages/asciidoc-preview
MIT License
141 stars 42 forks source link

HTML entity as variable replacement in headers #198

Closed AFulgens closed 8 years ago

AFulgens commented 8 years ago

Description

HTML entities as variable replacement in headers do not work in the preview.

Note: it may be a PEBKAC, does it even work in AsciiDoc? (i.e., I did not test it)

image

Syntax example

:todo: ☐
:done: ☑

# header {todo} ☐

{done} step done

{todo} step todo
ldez commented 8 years ago

Hello,

I don't have the full explanation of this behavior but it's the AsciiDoctor behavior.

I think it's related to http://asciidoctor.org/docs/user-manual/#subs.

In a normal case, attribute references are resolved before replacements and macros. But in a title case, attribute references are resolved after replacements and macros.

mojavelinux commented 8 years ago

@ldez That is exactly the correct explanation. This is one of those things I've never understood about AsciiDoc and would like to see changed. I say as much in the following issue, in which I also explain the workaround: https://github.com/asciidoctor/asciidoctor/issues/1173

This is not an issue with this Atom plugin and should therefore be closed.