Skip to content

Improve Smarty Delimiter issue - #522

Merged
geekwright merged 2 commits into
XOOPS:masterfrom
geekwright:smartydelima
Mar 11, 2017
Merged

geekwright merged 2 commits into
XOOPS:masterfrom
geekwright:smartydelima

Conversation

@geekwright

Copy link
Copy Markdown
Contributor

Not perfect, but smarter. Re #521

@trabisdementia

Copy link
Copy Markdown
Contributor

Consider this test:
<option value="{$id}"<{if $menu_id == $id}> selected='selected'{/if}>{$title}</option>

With that solution, I expect that no tags will be converted resulting in an error. :(

@geekwright

Copy link
Copy Markdown
Contributor Author

There is always a price to past sins :) Someone thought the non-standard smarty delimiters were a good idea. I think the ability to use examples from the manual, and builtin support in IDEs make ditching the legacy delimiters an even better idea. Hence the change.

The filter code is to make it easier to test modules from 2.5. It isn't a long term feature. It is pretty easy to spot where it will have problem in new development, and a change in whitespace will fix it.

Rather than introduce a more complex solution with inadequate consideration, this just improves the detection in a number cases.

@mambax7

mambax7 commented Mar 11, 2017

Copy link
Copy Markdown
Contributor

In modern IDE, like the PhpStorm, you can set the delimiters yourself, so this is not a problem anymore, especially since we've switched to .tpl extensions.
But being able to copy and paste examples from tutorials is definitely a good thing.

@geekwright

geekwright commented Mar 11, 2017

Copy link
Copy Markdown
Contributor Author

In modern IDE, like the PhpStorm, you can set the delimiters ...

But that is still a barrier, and there are a lot of IDE's besides PhpStorm. If it works out of the box with the default settings, that is a win IMO.

@trabisdementia

trabisdementia commented Mar 11, 2017 via email

Copy link
Copy Markdown
Contributor

@geekwright
geekwright merged commit 580d540 into XOOPS:master Mar 11, 2017
@geekwright
geekwright deleted the smartydelima branch March 11, 2017 18:56
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.

3 participants