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

Don't restore env.code from backupCode in Handlebars, PHP and Smarty … #998

Merged
merged 1 commit into from
Jul 14, 2016

Conversation

Golmote
Copy link
Contributor

@Golmote Golmote commented Jul 12, 2016

…components.

The PHP component used to store env.code in a backupCode property in the before-highlight hook and restore it in the before-insert hook. Both the Handlebars component and the Smarty component copied this behaviour.

I don't see any reason to do this currently, though. It seems it was made to work properly with the Line numbers plugin but it actually breaks it when used in conjunction with the Remove initial line feed plugin or the Normalize whitespace plugin...

The Line numbers plugins runs on the complete hook, which gets executed after the after-highlight hook, so the code used to compute the line numbers is the correct one.

This PR should fix #997 and probably fix #935.

@Flynxify
Copy link

Can confirm that this does fix #997.

@Golmote Golmote merged commit 36739b3 into PrismJS:gh-pages Jul 14, 2016
@Golmote Golmote deleted the before-insert-code-restore branch July 14, 2016 09:07
Golmote added a commit that referenced this pull request Sep 1, 2016
…lugins in the before-sanity-check hook. Fix #1018 (see issue for discussion)
thesave added a commit to thesave/prism that referenced this pull request Sep 2, 2016
* PrismJS/gh-pages:
  Autoloader plugin: don't try to load "none" component. Fix PrismJS#1000
  Optimized block regexps to prevent struggling on large files. Fixes
PrismJS#1001
  Revert PrismJS#998 + run normalize-whitespace and remove-initial-line-feed
plugins in the before-sanity-check hook. Fix PrismJS#1018 (see issue for
discussion)
  Run gulp

# Conflicts:
#	plugins/autoloader/prism-autoloader.min.js
mAAdhaTTah added a commit to mAAdhaTTah/prism that referenced this pull request Oct 8, 2016
* gh-pages: (107 commits)
  Reverse prism markup min
  JSON: Fixed issues with properties and strings + added tests. Fix PrismJS#1025
  Fix grammar in Readme
  Update CHANGELOG
  Update APL minified file + update test for iota underbar function
  Add iota underbar (PrismJS#1024)
  Fix typo `Fload` to `Float` in prism-ruby.js (PrismJS#1023)
  Autoloader plugin: don't try to load "none" component. Fix PrismJS#1000
  Optimized block regexps to prevent struggling on large files. Fixes PrismJS#1001
  Revert PrismJS#998 + run normalize-whitespace and remove-initial-line-feed plugins in the before-sanity-check hook. Fix PrismJS#1018 (see issue for discussion)
  Run gulp
  Makes CSS strings greedy. Fix PrismJS#1013
  update min file and reverse core
  add prefix feature for custom class plugin
  Make doctype case insensetive (PrismJS#1009)
  Optimize images (PrismJS#1007)
  Restore `viewBox` to Prism logo (PrismJS#1002)
  Remove unneeded prefixed CSS (PrismJS#989)
  Fix WPD plugin's page
  Fix WPD at-rule detection + don't process if language is not handled + fix plugin's page
  ...

# Conflicts:
#	plugins/show-language/prism-show-language.css
#	plugins/show-language/prism-show-language.js
#	plugins/show-language/prism-show-language.min.js
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.

None yet

2 participants