Skip to content
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

PHP: Inline-Mode doesn't handle closing PHP-Tags properly #3170

Closed
mutec opened this issue Dec 18, 2016 · 5 comments
Closed

PHP: Inline-Mode doesn't handle closing PHP-Tags properly #3170

mutec opened this issue Dec 18, 2016 · 5 comments

Comments

@mutec
Copy link

mutec commented Dec 18, 2016

If you set inline: true, PHP highlighting starts right from the beginning, but if you close the PHP-section/tag and try writing plain HTML, you'll still get a PHP-Highlighting (instead of un-highlighted text):
image
see also: https://jsfiddle.net/b0fqo0tj/

@nightwing
Copy link
Member

This was the intended behavior since inline mode is just for php, without any closing and opening tags.
Could you tell how/where do you use code like this? Maybe we need another mode for php.

@mutec
Copy link
Author

mutec commented Dec 18, 2016

I'm developing a CMS which provides the possibility to add custom PHP-contents which are edited via the CMS's control panel. As far as I know are some customers using self-designed forms which are based on a mix of PHP and HTML (or Smarty). For highlighting the HTML-code of those forms typing HTML outside the PHP-Section would be better (and can't cause problems escaping the ' or ").
For example the code from above: https://test.mysterycode.de/vortex/cms/index.php?wsctest/
The user-list is created by php and the blue info-box is displayed outside the PHP-tag.

In a nutshell: I'd need ACE's PHP-highlighting like it is (parsing closing and opening tags) but starting the highlighting from the first character to the closing PHP-Tag and then from another opening to closing tag (and so on).
I hope you got what I wanted to describe. :)

@mutec
Copy link
Author

mutec commented Jan 6, 2017

@nightwing Did you think about that yet or should I try to find a custom solution?

@nightwing
Copy link
Member

one possible solution is to find a way of passing "php-start" to https://github.com/ajaxorg/ace/blob/v1.2.6/lib/ace/tokenizer.js#L239 instead of using hardcoded "start" but i am not sure how to do it properly.

@github-actions
Copy link

github-actions bot commented May 9, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

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

No branches or pull requests

2 participants