Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I do strikethrough (line-through) in asciidoc?

How do I render a strikethrough (or line-through) in an adoc file?

Let's presume I want to write "That technology is -c-r-a-p- not perfect."

like image 605
Geoffrey De Smet Avatar asked Aug 06 '16 12:08

Geoffrey De Smet


People also ask

How do you write Asciidoc?

You can just start typing. In Asciidoctor, adjacent or consecutive lines of text form a paragraph element. To start a new paragraph after another element, such as a section title or table, hit the RETURN key twice to insert a blank line, and then continue typing your content.


2 Answers

That technology is [line-through]#crap# not perfect. 
like image 104
Jakub Jirutka Avatar answered Sep 24 '22 10:09

Jakub Jirutka


As per Ascii Doc manual, [line-through] is deprecated. You can test here.

Comment from Dan Allen

It's important to understand that line-through is just a CSS role. Therefore, it needs support from the stylesheet in order to appear as though it is working.

If I run the following through Asciidoctor (or Asciidoctor.js):

[.line-through]#strike#

I get:

<span class="line-through">strike</span>

The default stylesheet has a rule for this:

.line-through{text-decoration:line-through}

You would need to do the same.

It is possible to customize the HTML that is generated using custom templates (Asciidoctor.js supports Jade templates). In that case, you'd override the template for inline_quoted, check for the line-through role and produce either an <s> or, preferably, a <del> instead of the span.

like image 20
ric Avatar answered Sep 21 '22 10:09

ric



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!