Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Skip all embedded php code when parsing the style blocks in php documents.#7046

Merged
redmunds merged 4 commits intomasterfrom
rlim/php-inside-css
Mar 24, 2014
Merged

Skip all embedded php code when parsing the style blocks in php documents.#7046
redmunds merged 4 commits intomasterfrom
rlim/php-inside-css

Conversation

@RaymondLim
Copy link
Copy Markdown
Contributor

This fixes #6948.

@redmunds redmunds self-assigned this Mar 3, 2014
Comment thread src/language/HTMLUtils.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may be too hard-coded of a solution. Other devs will want to do something similar for other server-side markup. Also, the mode for php could eventally change to something more specific.

A more generic solution may be this:

  • Once you hit tokenModeName === modeName case, scan until you return to tokenModeName === outerMode
  • I am not sure if using outerMode will work in all cases, you might need to keep track of previousMode (the mode of token before you enter modeName mode), and then scan until you return to previousMode mode.

What do you think of either of those solutions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previousMode tracking may be more reliable if we can safely assume that we always have well-formed style blocks. Anyway, I'll make a change with that assumption until someone can prove that to be wrong.

@RaymondLim
Copy link
Copy Markdown
Contributor Author

@redmunds Ready for re-review.

@redmunds
Copy link
Copy Markdown
Contributor

Looks good. Merging.

redmunds added a commit that referenced this pull request Mar 24, 2014
Skip all embedded php code when parsing the style blocks in php documents.
@redmunds redmunds merged commit 528ef38 into master Mar 24, 2014
@redmunds redmunds deleted the rlim/php-inside-css branch March 24, 2014 20:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline CSS editor doesn't show full CSS

2 participants