Skip to content

Bad transform for node[attr=value+foobar] - #143

Open
KSR-Yasuda wants to merge 1 commit into
rstacruz:masterfrom
KSR-Yasuda:bugfix/SeparatorInAttribOrContent
Open

Bad transform for node[attr=value+foobar]#143
KSR-Yasuda wants to merge 1 commit into
rstacruz:masterfrom
KSR-Yasuda:bugfix/SeparatorInAttribOrContent

Conversation

@KSR-Yasuda

Copy link
Copy Markdown

It transform wrongly if separater <, >, + appears in attriutes ([attr=value+foobar]) or content ({content in the tag + foobar}).

script[src=https://example.co.jp/foobar.js+baz]

# => Current : <script class="co jp js" type="text/javascript"></script>
# => Expect  : <script src="https://example.co.jp/foobar.js+baz" type="text/javascript"></script>

Now it roughly split by the separater character appearance.

This patch fixes wrong token division afterward:
if unclosed [ or { appears, concatenate it with the following token.

@KSR-Yasuda

Copy link
Copy Markdown
Author

The code may be unstraightforward since I'm not familiar with Python.
Feel free to fix it if you can write more smarter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant