Skip to content

Commit

Permalink
Added support for plaintext (#2738)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored Mar 5, 2021
1 parent a120993 commit 970674c
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 24 deletions.
11 changes: 11 additions & 0 deletions components/prism-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ var Prism = (function (_self){
var lang = /\blang(?:uage)?-([\w-]+)\b/i;
var uniqueId = 0;

// The grammar object for plaintext
var plainTextGrammar = {};


var _ = {
/**
Expand Down Expand Up @@ -255,6 +258,14 @@ var _ = {
* @public
*/
languages: {
/**
* The grammar for plain, unformatted text.
*/
plain: plainTextGrammar,
plaintext: plainTextGrammar,
text: plainTextGrammar,
txt: plainTextGrammar,

/**
* Creates a deep copy of the language with the given id and appends the given tokens.
*
Expand Down
2 changes: 1 addition & 1 deletion components/prism-core.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/Prism.hooks.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h2>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line660">line 660</a>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line671">line 671</a>
</li></ul></dd>


Expand Down Expand Up @@ -152,7 +152,7 @@ <h4 class="name" id=".add"><span class="type-signature">(static) </span>add<span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line675">line 675</a>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line686">line 686</a>
</li></ul></dd>


Expand Down Expand Up @@ -314,7 +314,7 @@ <h4 class="name" id=".run"><span class="type-signature">(static) </span>run<span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line692">line 692</a>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line703">line 703</a>
</li></ul></dd>


Expand Down
12 changes: 6 additions & 6 deletions docs/Prism.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ <h4 class="name" id=".manual"><span class="type-signature">(static) </span>manua

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line48">line 48</a>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line51">line 51</a>
</li></ul></dd>


Expand Down Expand Up @@ -263,7 +263,7 @@ <h4 class="name" id=".highlight"><span class="type-signature">(static) </span>hi

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line601">line 601</a>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line612">line 612</a>
</li></ul></dd>


Expand Down Expand Up @@ -480,7 +480,7 @@ <h4 class="name" id=".highlightAll"><span class="type-signature">(static) </span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line448">line 448</a>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line459">line 459</a>
</li></ul></dd>


Expand Down Expand Up @@ -676,7 +676,7 @@ <h4 class="name" id=".highlightAllUnder"><span class="type-signature">(static) <

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line467">line 467</a>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line478">line 478</a>
</li></ul></dd>


Expand Down Expand Up @@ -911,7 +911,7 @@ <h4 class="name" id=".highlightElement"><span class="type-signature">(static) </

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line513">line 513</a>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line524">line 524</a>
</li></ul></dd>


Expand Down Expand Up @@ -1157,7 +1157,7 @@ <h4 class="name" id=".tokenize"><span class="type-signature">(static) </span>tok

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line637">line 637</a>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line648">line 648</a>
</li></ul></dd>


Expand Down
6 changes: 3 additions & 3 deletions docs/Prism.languages.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h2>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line257">line 257</a>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line260">line 260</a>
</li></ul></dd>


Expand Down Expand Up @@ -154,7 +154,7 @@ <h4 class="name" id=".extend"><span class="type-signature">(static) </span>exten

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line286">line 286</a>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line297">line 297</a>
</li></ul></dd>


Expand Down Expand Up @@ -354,7 +354,7 @@ <h4 class="name" id=".insertBefore"><span class="type-signature">(static) </span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line371">line 371</a>
<a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line382">line 382</a>
</li></ul></dd>


Expand Down
Loading

0 comments on commit 970674c

Please sign in to comment.