Closed akinori-ichigo closed 2 years ago
This conflicts with current syntax:
This is [Class_a]{:class-a} test other.
[Class_a]: link.html
Output:
<p>This is <a href="link.html">Class_a</a> test other.</p>
The IAL is not applied to the link which should probably be done but besides that changing the syntax is not possible.
I think the IAL has been applied to the link in Kramdown 2.3.1:
$ gem list kramdown
*** LOCAL GEMS ***
kramdown (2.3.1)
$ pry
[1] pry(main)> require "kramdown"
=> true
[2] pry(main)> Kramdown::Document.new(<<EOS).to_html
[2] pry(main)* This is [Class_a]{:.class-a} test other.
[2] pry(main)*
[2] pry(main)* [Class_a]: link.html
[2] pry(main)* EOS
=> "<p>This is <a href=\"link.html\" class=\"class-a\">Class_a</a> test other.</p>\n\n"
[3] pry(main)>
So is there any other way to apply an IAL to an otherwise un-markedup text span?
@cabo No, there is no such markup in kramdown. You would need to define a custom markup for this.
I made it to convert the text surrounded in square brackets with IAL to a plain span element. For example, "This is [CLASS_A]{:.class-a} text. This is [NO IAL] text." is converted to "\<p>This is \<span class="class-a">CLASS_A\</span> text. This is [NO IAL] text.\</p>". I think this feature get kramdown more expressive and useful.