Skip to content

Commit d3da912

Browse files
authored
Update codeit-autolinker.js
1 parent 6014627 commit d3da912

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/plugins/codeit-autolinker.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
Prism.plugins.autolinker = {
1515
processGrammar: function (grammar) {
16+
// abort if grammar has already been processed
17+
if (!grammar || grammar['url-link']) {
18+
return;
19+
}
1620
Prism.languages.DFS(grammar, function (key, def, type) {
1721
if (candidates.indexOf(type) > -1 && !Array.isArray(def)) {
1822
if (!def.pattern) {
@@ -41,6 +45,7 @@
4145
};
4246

4347
Prism.hooks.add('before-tokenize', function (env) {
48+
if (env.language === 'markdown') return;
4449
Prism.plugins.autolinker.processGrammar(env.grammar);
4550
});
4651

@@ -53,7 +58,7 @@
5358

5459
Prism.hooks.add('wrap', function (env) {
5560

56-
//if (env.language === 'markdown') return;
61+
if (env.language === 'markdown') return;
5762

5863
if (env.language === 'markdown' &&
5964
env.type === 'url-reference') {

0 commit comments

Comments
 (0)