aboutsummaryrefslogtreecommitdiff
path: root/mardown
diff options
context:
space:
mode:
Diffstat (limited to 'mardown')
-rw-r--r--mardown/ast_modifier.go2
-rw-r--r--mardown/ast_test.go14
2 files changed, 15 insertions, 1 deletions
diff --git a/mardown/ast_modifier.go b/mardown/ast_modifier.go
index 7437ab8..a9039ce 100644
--- a/mardown/ast_modifier.go
+++ b/mardown/ast_modifier.go
@@ -62,7 +62,7 @@ func modifier(lxs *lexers) (*astModifier, error) {
switch lxs.Current().Type {
case lexerLiteral:
s += lxs.Current().Value
- case lexerModifier:
+ case lexerModifier, lexerCode:
n := len(modInside.symbols)
if len(lxs.Current().Value) < n {
return nil, ErrInvalidModifier
diff --git a/mardown/ast_test.go b/mardown/ast_test.go
index 6712497..b270b18 100644
--- a/mardown/ast_test.go
+++ b/mardown/ast_test.go
@@ -31,4 +31,18 @@ func TestAst(t *testing.T) {
t.Errorf("failed, got %s", c)
t.Logf("lxs: %s\ntree: %s", lxs, tree)
}
+ content = "je suis un `code`"
+ lxs = lex(content)
+ tree, err = ast(lxs)
+ if err != nil {
+ t.Fatal(err)
+ }
+ c, err = tree.Eval()
+ if err != nil {
+ t.Fatal(err)
+ }
+ if c != "<p>je suis un <code>code</code></p>" {
+ t.Errorf("failed, got %s", c)
+ t.Logf("lxs: %s\ntree: %s", lxs, tree)
+ }
}