-
-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix modParser so we can output brackets around parsed elements #13904
Conversation
Maybe this will break 'Mosquito' tags like |
I tried the 'Mosquito' tag and it seems to work as expected:
Content of TestChunk: <strong>TestChunk</strong> Content of AnotherChunk: <strong>AnotherChunk</strong> Output: <strong>TestChunk</strong> |
The build(s) seem to fail with this change. I will check the failures and try to fix them this weekend. |
Made some changes and added some additional tests. The builds are passing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First it was okay, but then I noticed the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks the first parsed tag on page.
<title>[[*pagetitle]] - [[++site_name]]</title>
outputs
<title> - MODX Revolution</title>
in default template
@bezumkin thanks for noticing. Will try to find the issue later. Did you get an error in the log? |
@JoshuaLuckers Yep
|
Found the problem. Will try to fix it tomorrow. |
Solving this issue is more complex than expected. I'm not sure if I can solve it before 2.7.0 is released. |
@bezumkin I decided to use regular expressions to solve the issue. I do think it needs some more testing. |
Tried it with a more complex site and I found some more issues. I will add tests to check for these issues later. |
Pushed some changes that solves the issues I had. Any more testing would be appreciated. |
…ntent so we can output brackets around parsed elements.
…r the modParserTest.
…anged and committed a change).
… and an odd amount of those unique characters is being used in the original content. Fixes modxcms#13903
…the default MODX template).
f541ae5
to
9d4af06
Compare
All tests pass, awesome work! |
FYI, the site I use to test parser changes is completely broken in 2.x with or without this PR so I'm having a hard time verifying this. |
Tested and working :) Gives us possibilities with Formalicious :) |
Seems the issue was resolved by the author.
What does it do?
Find the position of the last occurrence of prefix in the original content so we can output brackets around parsed elements.
Why is it needed?
This way we can for example use the output as array key in a form input name.
Related issue(s)/PR(s)
#13903