Skip to content

Commit

Permalink
Avoid recognizing tag names when they have a prefix that is a recogni…
Browse files Browse the repository at this point in the history
…zed UL4 tag name.
  • Loading branch information
doerwalter committed Mar 7, 2022
1 parent 45066ff commit 64015e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Changes in HEAD (released 01/??/2022)
* Fixed a bug in the method :meth:`ll.orasql.Connection.getobject` (which we
only keep for backwards compatibility).

* Fixed a bug in parsing UL4 source code: UL4 would treat a tag name that
starts with a valid prefix as a valid tag name, although it shouldn't
(i.e. it treated ``<?printe?>`` and ``<?print e?>``).


Changes in 5.69 (released 11/17/2021)
-------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/ll/ul4c.py
Original file line number Diff line number Diff line change
Expand Up @@ -5343,7 +5343,7 @@ def _tokenize(self, source):
for each tag or non-tag text. It will be called by :meth:`_compile`
internally.
"""
pattern = r"<\?\s*(ul4|whitespace|printx|print|code|for|while|if|elif|else|end|break|continue|def|return|renderblocks|renderblock|renderx|render|note|doc|ignore)(\s*((.|\n)*?)\s*)?\?>"
pattern = r"<\?\s*(ul4|whitespace|printx|print|code|for|while|if|elif|else|end|break|continue|def|return|renderblocks|renderblock|renderx|render|note|doc|ignore)\b(\s*((.|\n)*?)\s*)?\?>"
# Last position
pos = 0
# Nesting level of ``<?ignore?>``/``<?end ignore?>``
Expand Down

0 comments on commit 64015e8

Please sign in to comment.