Commit b3e2856d authored by jerasmus's avatar jerasmus

Address code review comments

Addressed code review comments
parent 14a1621d
...@@ -445,7 +445,6 @@ export function stripPathTail(path = '') { ...@@ -445,7 +445,6 @@ export function stripPathTail(path = '') {
return path.replace(/[^/]+$/, ''); return path.replace(/[^/]+$/, '');
} }
export function getURLOrigin(url) { export function getURLOrigin(url) {
if (!url) { if (!url) {
return window.location.origin; return window.location.origin;
......
...@@ -15,7 +15,7 @@ const markPrefix = `${marker}-${Date.now()}`; ...@@ -15,7 +15,7 @@ const markPrefix = `${marker}-${Date.now()}`;
const reHelpers = { const reHelpers = {
template: `.| |\\t|\\n(?!(\\n|${markPrefix}))`, template: `.| |\\t|\\n(?!(\\n|${markPrefix}))`,
openTag: '<[^iframe]+.*?>', openTag: '<(?!iframe)[a-zA-Z]+.*?>',
closeTag: '</.+>', closeTag: '</.+>',
}; };
const reTemplated = new RegExp(`(^${wrapPrefix}(${reHelpers.template})+?${wrapPostfix}$)`, 'gm'); const reTemplated = new RegExp(`(^${wrapPrefix}(${reHelpers.template})+?${wrapPostfix}$)`, 'gm');
......
...@@ -815,7 +815,6 @@ describe('URL utility', () => { ...@@ -815,7 +815,6 @@ describe('URL utility', () => {
}); });
}); });
describe('getURLOrigin', () => { describe('getURLOrigin', () => {
it('when no url passed, returns correct origin from window location', () => { it('when no url passed, returns correct origin from window location', () => {
const origin = 'https://foo.bar'; const origin = 'https://foo.bar';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment