mehdown 2.53.0 → 2.53.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +2 -2
- package/lib/plugins/mediocre-com.js +1 -1
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -542,9 +542,9 @@ exports.html = {
|
|
|
542
542
|
getElementsByTagName: function(html, tag) {
|
|
543
543
|
return html.match(new RegExp('<' + tag + '[^>]*>', 'gi'));
|
|
544
544
|
},
|
|
545
|
-
permalinkHeaders: function(html, icon = 'fa-
|
|
545
|
+
permalinkHeaders: function(html, icon = 'fa-link') {
|
|
546
546
|
// $0 - whole match, $1 - opening tag and content, $2 - opening tag name (to match the end tag), $3 - value of id attr, $4 - closing tag
|
|
547
|
-
return html.replace(/(<(h\d)\s+id="([^"]+)">.+?)(<\/\2>)/gs,`$1<a class="permalink" href="#$3" title="Link
|
|
547
|
+
return html.replace(/(<(h\d)\s+id="([^"]+)">.+?)(<\/\2>)/gs,`$1<a class="permalink" href="#$3" title="Link"><i class="fa ${icon}"></i></a>$4`);
|
|
548
548
|
},
|
|
549
549
|
removeAttribute: function(html, attribute) {
|
|
550
550
|
if (!html) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const productionSites = '(?:https?:\\/\\/(?:www\\.)?)?(?<site>(?:casemates|mediocre|mediocritee|meh|morningsave|pastadrop|sidedeal|stellacarmina)\\.com)?';
|
|
2
2
|
const debugSites = '(?:https?:\\/\\/)?(?<siteLocal>(?:127\\.0\\.0\\.1|localhost):\\d{4})?';
|
|
3
|
-
const path = '\\/(?<path>(?<type>deals|polls)\\/(?:[-\\w]+))';
|
|
3
|
+
const path = '\\/(?<path>(?<type>deals|polls)\\/(?:[-\\w%]+))';
|
|
4
4
|
let regExp = new RegExp(`${productionSites}${path}`);
|
|
5
5
|
if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'staging') {
|
|
6
6
|
// Allow iframes for any localhost deal/poll links on debug, but also make sure tests pass...
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"markdown-it": "~13.0.0",
|
|
8
8
|
"mehdown-cowsay": "~1.1.6",
|
|
9
9
|
"minimist": "~1.2.5",
|
|
10
|
-
"natural": "~5.2.
|
|
10
|
+
"natural": "~5.2.4",
|
|
11
11
|
"probe-image-size": "~7.2.0",
|
|
12
12
|
"rel-to-abs": "~0.1.0",
|
|
13
13
|
"request": "~2.88.0",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
|
|
34
34
|
"test": "mocha --reporter spec test/*"
|
|
35
35
|
},
|
|
36
|
-
"version": "2.53.
|
|
36
|
+
"version": "2.53.2"
|
|
37
37
|
}
|