-
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
Autolinker not functioning (on prismjs.com) #359
Comments
Which is exactly the same statement with #358. I did a quick debugging and the problem seems to be in var patterns = grammar[token];
patterns = (_.util.type(patterns) === "Array") ? patterns : [patterns]; in which var patterns = grammar[token].tokens;
patterns = (_.util.type(patterns) === "Array") ? patterns : [patterns]; I don’t know enough about Prism’s internals to determine whether this should be fixed here or where things are fed into |
@uranusjr It looks like you have a pretty good idea of the problem, why not submit a |
As I said in the last paragraph, I don’t know enough about Prism’s internals. I’m not even confident that my “fix” is correct. |
Right, but the author can decide if it is or not. In the 'contributing' section the author asks people to submit small patches that address single issues. Yours is perfect and even if it isn't correct it probably provides a better starting place than my issue which was basically just "it's broken." I encourage you to submit a |
If the fix would be to replace just the one line
I tried it in my local environment and ... it doesn't work :( |
There is a new feature, where you can add multiple patterns in the form of an array to one token type. This causes the problem, because autolinker uses Prism.languages.DFS to traverse the language and Prism.languages.DFS doesn't account for the new feature. The best fix would be to fix DFS. Since I implemented the array feature I will fix this and make a PR. |
Closing, see #425 |
On http://prismjs.com/plugins/autolinker/ the examples aren't working (and it's a weird white text on white background that is only visible due to text shadow--okaida theme, default looks fine).
The
console
readsUncaught TypeError: undefined is not a function
at/prism.js:249
The text was updated successfully, but these errors were encountered: