You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Put in a directive like the following:
<include
src="foobaz.html"
</include>
2. Run the grit tool on that file
3. Observe the </include> is left behind
What is the expected output? What do you see instead?
</include> should no longer be there. It should have been removed when the file
was inlined.
What version of the product are you using? On what operating system?
r126
Please provide any additional information below.
The proposed fix is below:
For the tags that get replaced wholesale, change the .*> at the end to .*?> and
use the modifier re.DOTALL to include newlines.
--- grit/format/html_inline.py (revision 126)
+++ grit/format/html_inline.py (working copy)
@@ -33,10 +33,10 @@
# Used by DoInline to replace various links with inline content.
_STYLESHEET_RE = lazy_re.compile(
'<link rel="stylesheet"[^>]+?href="(?P<filename>[^"]*)".*?>',
- re.MULTILINE)
+ re.DOTALL)
_INCLUDE_RE = lazy_re.compile(
- '<include[^>]+?src="(?P<filename>[^"\']*)".*>',
- re.MULTILINE)
+ '<include[^>]+?src="(?P<filename>[^"\']*)".*?>',
+ re.DOTALL)
_SRC_RE = lazy_re.compile(
r'<(?!script)(?:[^>]+?\s)src=(?P<quote>")(?P<filename>[^"\']*)\1',
re.MULTILINE)
Original issue reported on code.google.com by [email protected] on 13 Jun 2013 at 7:51
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 13 Jun 2013 at 7:51The text was updated successfully, but these errors were encountered: