textile-spec icon indicating copy to clipboard operation
textile-spec copied to clipboard

Support non-semantic tags for underline, strike-through and teletype text

Open waldyrious opened this issue 4 years ago • 2 comments

Currently there are variants for two of the inline formatting markers (* and _ for <strong> and <em>, respectively), that allow styling text in the same manner but without the semantic meaning that the primary markers are meant to convey — i.e., as bold (<b>) and italic (<i>).

I believe it is reasonable to expect that the same behavior would also apply to the other formatting options that HTML supports in both semantic and stylistic variants, namely <ins>/<u>, <del>/<s>, and <code>/<tt>:

semantic (single markers) stylistic (double markers)
*foobar*<strong>foobar</strong> **foobar**<b>foobar</b>
_foobar_<em>foobar</em> __foobar__<i>foobar</i>
+foobar+<ins>foobar</ins> ++foobar++<u>foobar</u>
-foobar-<del>foobar</del> --foobar--<s>foobar</s>
@foobar@<code>foobar</code> @@foobar@@<tt>foobar</tt>

IMO Textile would be more consistent and predictable if all these combinations behaved the same way.

waldyrious avatar Apr 02 '21 10:04 waldyrious

For reference, here's how some of the existing implementations currently render these:

Textile textile-lang.com textile.js try.redcloth.org
--foobar-- &#8212;foobar&#8212;
—foobar—
<del>-foobar-</del>
-foobar-
++foobar++ ++foobar++
++foobar++
@@foobar@@ <code></code>foobar@@
foobar@@
<code>@foobar@</code>
@foobar@
@@foobar@@
@@foobar@@

Even if the extension proposed above isn't adopted, at least the double-marker behavior could be explicitly specified so it is consistent. For example, either of the two alternatives below would improve the consistency of all the implementations above:

  1. Ignoring the double markers as Textile syntax; (as currently done by try.redcloth.org for --)
  2. Recognizing the outer markers as Textile syntax, and leaving the inner ones untouched. (as currently done by textile.js for @@, and all three for ++)
Textile HTML (option 1) HTML (option 2)
--foobar-- --foobar--[1] <del>-foobar-</del>
++foobar++ ++foobar++ <ins>+foobar+</ins>
@@foobar@@ @@foobar@@ <code>@foobar@</code>

1. optionally with typographical enhancement, i.e. "—foobar—"

waldyrious avatar Apr 02 '21 10:04 waldyrious

Since this repo hasn't seen much activity lately, I'm taking the liberty to ping @philwareham, who's been actively maintaining the textile/textile-lang-com-website repo.

waldyrious avatar Apr 02 '21 10:04 waldyrious