-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 Comment with <element> inside #197
Labels
Comments
Problem is related on line 80 of prism-php.js, using: Prism.languages.insertBefore('php', 'keyword', {
'markup': {
pattern: /a^/g,
inside: Prism.languages.markup
}
}); temporary solve the issue. |
Do your changes still work well when mixing HTML and PHP? |
Hi take a look at this prism plugin: https://github.com/foo123/prism-grammar User can define a JSON grammar (quite flexibly) to be used for prism for a specific language PS i am the author |
zeitgeist87
added a commit
to zeitgeist87/prism
that referenced
this issue
Feb 10, 2017
This patch is an attempt to fix the PHP language, when it is combined with markup. The problem is, that markup has a higher priority than all other tokens. This leads to weird errors, where HTML tags are highlighted inside of comments PrismJS#197. One solution to this was to set the `greedy` flag for the comment token, but this leads to far worse errors like PrismJS#1097. This patch should fix both issues PrismJS#197 and PrismJS#1097, by switching the grammar to markup on the fly. One potential problem is, that it relies on the `<?php` tag to detect if markup is present. So if a PHP file contains only markup and no PHP code at all, the result will look broken.
Merged
zeitgeist87
added a commit
to zeitgeist87/prism
that referenced
this issue
Feb 11, 2017
This patch is an attempt to fix the PHP language, when it is combined with markup. The problem is, that markup has a higher priority than all other tokens. This leads to weird errors, where HTML tags are highlighted inside of comments PrismJS#197. One solution to this was to set the `greedy` flag for the comment token, but this leads to far worse errors like PrismJS#1097. This patch should fix both issues PrismJS#197 and PrismJS#1097, by switching the grammar to markup on the fly. One potential problem is, that it relies on the `<?php` tag to detect if markup is present. So if a PHP file contains only markup and no PHP code at all, the result will look broken.
zeitgeist87
added a commit
to zeitgeist87/prism
that referenced
this issue
Mar 10, 2017
This patch is an attempt to fix the PHP language, when it is combined with markup. The problem is, that markup has a higher priority than all other tokens. This leads to weird errors, where HTML tags are highlighted inside of comments PrismJS#197. One solution to this was to set the `greedy` flag for the comment token, but this leads to far worse errors like PrismJS#1097. This patch should fix both issues PrismJS#197 and PrismJS#1097, by switching the grammar to markup on the fly. One potential problem is, that it relies on the `<?php` tag to detect if markup is present. So if a PHP file contains only markup and no PHP code at all, the result will look broken.
zeitgeist87
added a commit
to zeitgeist87/prism
that referenced
this issue
May 8, 2017
This patch is an attempt to fix the PHP language, when it is combined with markup. The problem is, that markup has a higher priority than all other tokens. This leads to weird errors, where HTML tags are highlighted inside of comments PrismJS#197. One solution to this was to set the `greedy` flag for the comment token, but this leads to far worse errors like PrismJS#1097. This patch should fix both issues PrismJS#197 and PrismJS#1097, by switching the grammar to markup on the fly. One potential problem is, that it relies on the `<?php` tag to detect if markup is present. So if a PHP file contains only markup and no PHP code at all, the result will look broken.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is some issue on syntax highlight in PHP
In test drive, when you enable PHP there is an issue that do not display the second item as comment. Clike syntax work fine.
After some debugging seam to be an issue related to markup, if I add a
&& false
at line 40 of prism-php.js the syntax highlight work fine.The text was updated successfully, but these errors were encountered: