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

Add before-highlightall hook #890

Merged
merged 1 commit into from
Feb 14, 2016
Merged

Add before-highlightall hook #890

merged 1 commit into from
Feb 14, 2016

Conversation

LeaVerou
Copy link
Member

Needed for unescaped markup plugin, as discussed in #887.
Alternatively, we could reinstate @zeitgeist87’s PR about making the selector a config option.
Thoughts?

Needed for unescaped markup plugin, as discussed in #887.
Alternatively, we could reinstate @zeitgeist87’s PR about making the selector a config option.
Thoughts?
@mAAdhaTTah
Copy link
Member

If we're getting a before-highlightall hook, can we get an after-highlightall hook as well?

@LeaVerou
Copy link
Member Author

For parity or because there are use cases?

@mAAdhaTTah
Copy link
Member

A place to resolve a promise was what I was thinking originally, though in retrospect, it wouldn't actually handle what I was trying to do at the time, which was resolve a promise when all the async highlighting was finished. I ended up not going that route, so maybe it's not necessary, but I thought it might still be useful to include.

@zeitgeist87
Copy link
Collaborator

Alternatively, we could reinstate @zeitgeist87’s PR about making the selector a config option.

The hook before-highlightall is definitely a better solution than the config option. How about this small addition:

var elements = env.elements || document.querySelectorAll(env.selector);

This would optionally enable a plugin to select/filter the elements directly. Could be useful in the future...

@LeaVerou
Copy link
Member Author

I like that idea!

LeaVerou added a commit that referenced this pull request Feb 14, 2016
@LeaVerou LeaVerou merged commit 49a3324 into gh-pages Feb 14, 2016
@LeaVerou LeaVerou deleted the LeaVerou-patch-1 branch February 14, 2016 00:33
mAAdhaTTah added a commit to mAAdhaTTah/prism that referenced this pull request Feb 25, 2016
* gh-pages: (22 commits)
  Remove direction-property from themes
  Add tests for new greedy-pattern feature and fix bug in Kotlin
  Fix double HTML-encoding bug in Groovy language
  Add comments to better document the greedy-pattern feature
  Partial solution for the "Comment-like substrings"-problem
  Add property 'aliasTitles' to components.js
  [unescaped markup] Fix small issues @zeitgeist87 pointed out
  [unescaped markup] Fixed bug with escaped </script>
  Added unescaped markup plugin (hidden)
  Implemented @zeitgeist87’s suggestion in PrismJS#890 re: env.elements
  Changed weight in the header, as we’re now 2KB minified & gzipped. Also way overdue :)
  Changed the text in the header. Way overdue, as Prism’s popularity has way surpassed that of Dabblet
  Add before-highlightall hook
  Fix catastrophic backtracking regex issues
  Add missing prism.js to the documentation of normalize-whitespace
  Cleanup normalize-whitespace and improve keep-markup integration
  Preserve Markup in Normalize-Whitespace plugin
  Update CHANGELOG and run gulp
  Removed firstWhiteSpaces code
  Add support for automatic line breaks
  ...

# Conflicts:
#	components.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.

3 participants