Skip to content

Commit

Permalink
Implement plain text starting with < in Diet templates.
Browse files Browse the repository at this point in the history
This is the Jade way to emit conditional comments but works
with all plain text starting with <, too.

See http://jade-lang.com/reference/comments/.
  • Loading branch information
redstar committed Mar 9, 2015
1 parent 17fac21 commit 1deb2ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/vibe/templ/diet.d
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,9 @@ private struct DietCompiler(TRANSLATE...)
output.pushNode("-}");
} else if( ln[0] == '|' ){ // plain text node
buildTextNodeWriter(output, ln[1 .. ln.length], level, prepend_whitespaces);
} else if( ln[0] == '<' ){ // plain text node starting with <
assertp(next_indent_level <= level, "Child elements for plain text starting with '<' are not supported.");
buildTextNodeWriter(output, ln, level, prepend_whitespaces);
} else if( ln[0] == ':' ){ // filter node (filtered raw text)
// find all child lines
size_t next_tag = m_lineIndex+1;
Expand Down

0 comments on commit 1deb2ce

Please sign in to comment.