chadbraunduin / markdown.bash

A Markdown interpreter using only traditional Unix tools
182 stars 45 forks source link

a case where "mailto" match fails #11

Open dubiouscript opened 5 years ago

dubiouscript commented 5 years ago

it appears that when trying to parse mdsh.md some thing ... https://github.com/chadbraunduin/markdown.bash/blob/1a7d5a5e6b88fd69a60607cfc64f74dc95e4e730/markdown.sh#L341 is not working correctly ..

eg

wget https://github.com/bashup/mdsh/blob/master/mdsh.md markdown.sh ./mdsh.md

...

### @require

`@require` *module cmd [args...]* will run *cmd args...* if it is the first call to `@require` for the named *module*.  The *cmd* should usually be `mdsh-source` or `mdsh-embed`, to include markdown modules or shell script modules, respectively, but it can be any command or function.  During execution of *cmd*, `MDSH_MODULE` will be set to *modulename*, allowing the running code to know it's being used as a module, potentially compiling itself differently.  (Normally, `MDSH_MODULE` is empty.)

becomes

<h3>@require</h3>

<p>
`@require<code> <a href="mailto:em>module cmd [args...]</em> will run <em>cmd args...</em> if it is the first call to </code>@require<code> for the named <em>module</em>.  The <em>cmd</em> should usually be </code>mdsh-source<code> or </code>mdsh-embed<code>, to include markdown modules or shell script modules, respectively, but it can be any command or function.  During execution of <em>cmd</em>, </code>MDSH<em>MODULE<code> will be set to <em>modulename</em>, allowing the running code to know it's being used as a module, potentially compiling itself differently.  (Normally, </code>MDSH</em">em>module cmd [args...]</em> will run <em>cmd args...</em> if it is the first call to <code>@require</code> for the named <em>module</em>.  The <em>cmd</em> should usually be <code>mdsh-source</code> or <code>mdsh-embed</code>, to include markdown modules or shell script modules, respectively, but it can be any command or function.  During execution of <em>cmd</em>, <code>MDSH<em>MODULE</code> will be set to <em>modulename</em>, allowing the running code to know it's being used as a module, potentially compiling itself differently.  (Normally, <code>MDSH</em</a>MODULE</code> is empty.)
</p>

=s

ftr this:mdown.awk works for this case

https://github.com/wernsey/d.awk

.. using this method https://github.com/wernsey/d.awk/blob/853e3a6940f193a72c7b67840bcbf822f1f476c1/mdown.awk#L384

match(tg, "^[[:graph:]]+@[[:graph:]]+$")

so long and thanks for all the scripts :scroll: