Customize Underline and Strike-Through Text

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Customize Underline and Strike-Through Text

devunwired
Greetings -

Is it possible to customize the HTML output that Asciidoctor generates for the underline and strike-through text formatting? I do not see where this is located in any of the templates.

I have an Asciidoc document (that must remain compatible with asciidoc.py syntax for the time being), that uses the following macros:

[underline]#Am I underlined?# [line-through]#Strike that from the record!#

I would like to embed the HTML from this document into a CMS that uses a WYSIWYG editor. The editor only supports the <u> tag for underline and the <del> tag for strike-through, but the current back-end generates a <span> tag with a class for each of these cases. Is there a way to customize this?
Reply | Threaded
Open this post in threaded view
|

Re: Customize Underline and Strike-Through Text

mojavelinux
Administrator
Underline is currently handled entirely by the stylesheet. However, you can bake logic into the template to look for a specific role (such as underline) and use the <u> element instead.

In the inline_quoted.html.slim, you'd use something like:

- case type
  when :emphasis
  em class=role =text
/...other built-in types...
- else
  - if has_role? 'underline'
    u=text
  - elseif role?
    span role=role =text
  - else
    =text

You can tweak the logic as it works best for you.

-Dan

On Thu, Jan 21, 2016 at 11:34 AM, devunwired [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Greetings -

Is it possible to customize the HTML output that Asciidoctor generates for the underline and strike-through text formatting? I do not see where this is located in any of the templates.

I have an Asciidoc document (that must remain compatible with asciidoc.py syntax for the time being), that uses the following macros:

[underline]#Am I underlined?# [line-through]#Strike that from the record!#

I would like to embed the HTML from this document into a CMS that uses a WYSIWYG editor. The editor only supports the <u> tag for underline and the <del> tag for strike-through, but the current back-end generates a <span> tag with a class for each of these cases. Is there a way to customize this?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Customize-Underline-and-Strike-Through-Text-tp4214.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
|

Re: Customize Underline and Strike-Through Text

devunwired
Thanks for the tip! That worked like a charm.

Cheers.
Dave Smith, PE
@devunwired
Reply | Threaded
Open this post in threaded view
|

Re: Customize Underline and Strike-Through Text

mojavelinux
Administrator
Nice!

-Dan

On Thu, Jan 21, 2016 at 3:24 PM, devunwired [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks for the tip! That worked like a charm.

Cheers.
Dave Smith, PE
@devunwired


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Customize-Underline-and-Strike-Through-Text-tp4214p4217.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen