@banta/sdk 4.7.1 → 4.7.3
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/fesm2020/banta-sdk.mjs
CHANGED
|
@@ -224,7 +224,7 @@ class BantaMarkdownToHtmlPipe {
|
|
|
224
224
|
const linkRenderer = this.renderer.link;
|
|
225
225
|
this.renderer.link = (href, title, text) => {
|
|
226
226
|
const html = linkRenderer.call(this.renderer, href, title, text);
|
|
227
|
-
return html.replace(/^<a /, '<a target="_blank" rel="noopener nofollow" ');
|
|
227
|
+
return html.replace(/^<a /, '<a target="_blank" rel="noopener noreferrer nofollow" ');
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
230
|
transform(value) {
|
|
@@ -238,7 +238,7 @@ class BantaMarkdownToHtmlPipe {
|
|
|
238
238
|
if ('target' in node) {
|
|
239
239
|
node.setAttribute('target', '_blank');
|
|
240
240
|
// prevent https://www.owasp.org/index.php/Reverse_Tabnabbing
|
|
241
|
-
node.setAttribute('rel', 'noopener noreferrer');
|
|
241
|
+
node.setAttribute('rel', 'noopener noreferrer nofollow');
|
|
242
242
|
}
|
|
243
243
|
// set non-HTML/MathML links to xlink:show=new
|
|
244
244
|
if (!node.hasAttribute('target')
|
|
@@ -10318,7 +10318,14 @@ class YouTubeAttachmentResolver {
|
|
|
10318
10318
|
if (fragment.type !== 'url')
|
|
10319
10319
|
return null;
|
|
10320
10320
|
let videoId;
|
|
10321
|
-
|
|
10321
|
+
// https://youtu.be/jXzJ7FlqX6M
|
|
10322
|
+
if (fragment.text.match(/^https:\/\/youtu\.be\//)) {
|
|
10323
|
+
let match = /^https:\/\/youtu\.be\/([^\/]+)/.exec(fragment.text);
|
|
10324
|
+
if (match) {
|
|
10325
|
+
videoId = match[1];
|
|
10326
|
+
}
|
|
10327
|
+
}
|
|
10328
|
+
if (!videoId && fragment.text.match(/^https?:\/\/(www\.|m\.)?youtube.com\/watch\?v=/)) {
|
|
10322
10329
|
let match = /watch\?v=([^&]+)/.exec(fragment.text);
|
|
10323
10330
|
if (match) {
|
|
10324
10331
|
videoId = match[1];
|