summaryrefslogtreecommitdiffhomepage
path: root/lexer.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-07-12 15:26:33 +0200
committerGitHub <noreply@github.com>2022-07-12 15:26:33 +0200
commit1219d7efa170bf38fb1bf6a10fa0d1f96e62f091 (patch)
treebc7572abb64a48b57641902c028074eaab87ef0a /lexer.c
parent0229aea78553da64ebdc128257e8ab43c300842c (diff)
parentfd433aa285ff2b4f6270d6993d1b258ad48af36e (diff)
Merge pull request #95 from jow-/lexer-fix-non-lstrip-parsing
lexer: fix parsing with disabled block left stripping
Diffstat (limited to 'lexer.c')
-rw-r--r--lexer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lexer.c b/lexer.c
index aae3e2f..5be8ece 100644
--- a/lexer.c
+++ b/lexer.c
@@ -887,9 +887,12 @@ lex_step(uc_lexer_t *lex, FILE *fp)
buf_consume(lex, 1);
}
- /* global block lstrip */
- else if (lex->config && lex->config->lstrip_blocks) {
- rv = lookbehind_to_text(lex, lex->source->off, TK_TEXT, " \t\v\f\r");
+ /* put out text leading up to the opening tag and potentially
+ * strip trailing white space from it depending on the global
+ * block lstrip setting */
+ else {
+ rv = lookbehind_to_text(lex, lex->source->off, TK_TEXT,
+ (lex->config && lex->config->lstrip_blocks) ? " \t\v\f\r" : NULL);
}
}
else {