MCPcopy Create free account
hub / github.com/cnodejs/nodeclub / _EncodeAmpsAndAngles

Function _EncodeAmpsAndAngles

public/libs/showdown.js:1231–1242  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

1229
1230
1231var _EncodeAmpsAndAngles = function(text) {
1232// Smart processing for ampersands and angle brackets that need to be encoded.
1233
1234 // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:
1235 // http://bumppo.net/projects/amputator/
1236 text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&");
1237
1238 // Encode naked <'s
1239 text = text.replace(/<(?![a-z\/?\$!])/gi,"&lt;");
1240
1241 return text;
1242}
1243
1244
1245var _EncodeBackslashEscapes = function(text) {

Callers 2

_StripLinkDefinitionsFunction · 0.70
_RunSpanGamutFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected