File Highlight and dynamically loaded content
See original GitHub issueHey,
first of all: great work here!
I got a documentation page where I load some views via AJAX. I know that I must call Prism.highlightAll();
when I want to get Prism working on dynamically loaded content. But somehow this doesn’t work with all the additional plugins like File Highlight or Line Highlight. They just don’t apply.
Is this on purpose, a bug or what can I do to get them also running on dynamically loaded content? 😃
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Highlight (change background) / of the content in a web ...
Is there any way to change the background-color of text in a web page dynamically, while select ...
Read more >Solved: JavaScript and dynamically loaded elements
My script works just the way I want it in the full calendar event view because I can simply use: $(document).ready(function() and document....
Read more >Loading Script Files Dynamically
For loading a script file dynamically using JavaScript, the basic steps are: Create the script element; Set the src attribute on the script...
Read more >Editing dynamic content in ContentCreator
Editing dynamic content in ContentCreator ... ContentCreator detects editable content on the basis of editor identifiers. The editing functions (EasyEdit and ...
Read more >How to SCRAPE DYNAMIC websites with Selenium - YouTube
How I use Selenium and Python to automate a browser to scrape data from dynamic websites. These sites load the content through JS...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi there! I’m no JavaScript ninja but I did find a solution. I don’t know if it’s the best one, but it worked for me. So here it is:
Basically what I did was turn the self-executing anonymous function into one that you can actually call, called
fileHighlight()
. Now you just have to call it whenever you need it 😉I know it’s bad to rewrite third-party code, but I don’t know how to extend it properly.
I consider this issue was fixed by #514.