simonmichael / hledger_site

The repo for hledger.org, the hledger project's website.
GNU General Public License v3.0
64 stars 39 forks source link

Fix regex `|` being parsed as markdown table separator #40

Closed lubieowoce closed 3 years ago

lubieowoce commented 3 years ago

Closes #39. Looks like the DEV version of the docs switched the table to just be a code block anyway, but it's still nice to not have broken tables in 1.21 :)

lubieowoce commented 3 years ago

btw here's the new table - since this is github, GFM-style tables should work fine

If name matches regular expression: account type is:
^assets?(:\|$) Asset
^(debts?\|liabilit(y\|ies))(:\|$) Liability
^equity(:\|$) Equity
^(income\|revenue)s?(:\|$) Revenue
^expenses?(:\|$) Expense
If account type is Asset and name does not contain regular expression: account type is:
(investment\|receivable\|:A/R\|:fixed) Cash
simonmichael commented 3 years ago

I don't think this fix works - unless I'm confused, the backslash ends up visible:

Screen Shot 2021-06-23 at 2 25 07 PM

So I still think the fix chosen for https://github.com/simonmichael/hledger/issues/1573 is the best option. Do you agree ? If so, should we do the same thing in all old versions of the manual ?

lubieowoce commented 3 years ago

the backslash ends up visible

Ugh, looks like this should work, but the parser has a bug: https://github.com/raphlinus/pulldown-cmark/issues/356. That's what I get for trusting a spec and submitting a fix w/o checking if it works... the ascii-art table on DEV is fine, and backporting it to older versions makes sense.

simonmichael commented 3 years ago

Alas, using mdbook means giving up the highly reliable pandoc!