The official chat room for Asciidoctor, a modern text processor and publishing toolchain for the AsciiDoc markup language.
~
I've done that with handlebars :-)
I have a JSON document that looks like this
{
"name" : "Price",
"type" : "Currency",
"pattern" : "/^((0)|([1-9]([0-9]){0,9}))((\\\\.(\\\\d\\\\d)))?$/"
}
Using a Mustache template, this is converted into this AsciiDoc document
= Test
== Table
[separator="@"]
|===
@ Name
@ Type
@ Pattern
@ Price
@ Currency
a@ `/^((0)|([1-9]([0-9]){0,9}))((\\.(\\d\\d)))?$/`
|===
The regex is legacy and not well written, but it is valid. However, when rendered, the generated HTML for the regex pattern doesn't look right:
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>/^0)|([1-9]([0-9]){0,9}\\.(\\d\\d)?$/</code></p>
</div></div></td>
</tr>
Looks like all ((
and ))
occurrences are stripped out. Any ideas how can I render the regex in the output correctly?
+++<code>/^((0)|([1-9]([0-9]){0,9}))((\\.(\\d\\d)))?$/</code>+++
<
in my regex though...
<
, though, I should use the single plus passthrough. Thanks!
+
`+CONTENT HERE+`
+
to demarcate literal passthroughs?
the separater has to be a single character
In the docs it is mentioned that:
Each data format has a default separator associated with it (csv = comma, tsv = tab, dsv = colon), but the separator can be changed to any character (or even a string of characters) by setting the separator attribute on the table.
@behrangsa is a shorthand for pass:c[]
so:
`+text+`
is like:
`pass:c[text]`
this is explained here: https://asciidoctor.org/docs/user-manual/#literal-monospace
video
nodes?