Use '_' instead of '.' for numbering cosmo escapes
because it gets syntax highlighted weird because '.' is not valid for like a variable name so the syntax highlighter is splitting the escape phrase at the '.' which means that phrase won't match when unescaped so it fails to get unescaped for example, this would fail: ``` $$ct ```
This commit is contained in:
@@ -398,11 +398,14 @@ Edit Makefile:
|
||||
|
||||
--add-host=git.domain.abc=$(loopback) \
|
||||
|
||||
Rebuild image:
|
||||
|
||||
```console
|
||||
$ make image-rm image-build
|
||||
```
|
||||
|
||||
Run tests:
|
||||
|
||||
```console
|
||||
$ make test
|
||||
●●●●
|
||||
|
||||
@@ -48,7 +48,7 @@ escape_cosmo = (str) ->
|
||||
|
||||
cosmo = parse_cosmo! / (tpl) ->
|
||||
counter += 1
|
||||
key = "#{dollar_temp}.#{counter}"
|
||||
key = "#{dollar_temp}_#{counter}"
|
||||
escapes[key] = tpl
|
||||
key
|
||||
|
||||
@@ -59,7 +59,7 @@ escape_cosmo = (str) ->
|
||||
unescape_cosmo = (str, escapes) ->
|
||||
import P, R, Cmt, Cs from require "lpeg"
|
||||
|
||||
escape_patt = P(dollar_temp) * P(".") * R("09")^1 / (key) ->
|
||||
escape_patt = P(dollar_temp) * P("_") * R("09")^1 / (key) ->
|
||||
escapes[key] or error "bad key for unescape_cosmo"
|
||||
|
||||
patt = Cs (escape_patt + P(1))^0 * P(-1)
|
||||
@@ -84,8 +84,6 @@ write_exec = (cmd, content) ->
|
||||
|
||||
fname
|
||||
|
||||
-- config command like this in site.moon:
|
||||
-- require("renderers.markdown").cmd = "pandoc --mathjax >"
|
||||
class PandocRenderer extends require "sitegen.renderers.html"
|
||||
@escape_cosmo: escape_cosmo
|
||||
@unescape_cosmo: unescape_cosmo
|
||||
|
||||
Reference in New Issue
Block a user