Merge branch 'master' into mct-7442-7959

This commit is contained in:
Jamie V. 2025-04-04 13:30:45 -07:00 committed by GitHub
commit da1b7b521a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 687 additions and 640 deletions

View File

@ -56,7 +56,7 @@ jobs:
run: npm run cov:e2e:report
- name: Publish Results to Codecov.io
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/e2e/lcov.info

View File

@ -54,8 +54,7 @@ const examplePlanSmall1 = JSON.parse(
const TIME_TO_FROM_COLUMN = 2;
const HEADER_ROW = 0;
const NUM_COLUMNS = 5;
const FULL_CIRCLE_PATH =
'M3.061616997868383e-15,-50A50,50,0,1,1,-3.061616997868383e-15,50A50,50,0,1,1,3.061616997868383e-15,-50Z';
const FULL_CIRCLE_PATH = 'M0,-50A50,50,0,1,1,0,50A50,50,0,1,1,0,-50Z';
/**
* The regular expression used to parse the countdown string.

1260
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -16,25 +16,25 @@
],
"devDependencies": {
"@babel/eslint-parser": "7.23.3",
"@braintree/sanitize-url": "6.0.4",
"@braintree/sanitize-url": "7.1.1",
"@types/d3-axis": "3.0.6",
"@types/d3-scale": "4.0.8",
"@types/d3-selection": "3.0.10",
"@types/d3-shape": "3.0.0",
"@types/d3-shape": "3.1.7",
"@types/eventemitter3": "1.2.0",
"@types/jasmine": "5.1.2",
"@types/lodash": "4.17.0",
"@vue/compiler-sfc": "3.4.3",
"babel-loader": "9.1.0",
"babel-plugin-istanbul": "6.1.1",
"babel-plugin-istanbul": "7.0.0",
"comma-separated-values": "3.6.4",
"copy-webpack-plugin": "12.0.2",
"copy-webpack-plugin": "13.0.0",
"cspell": "7.3.8",
"css-loader": "6.10.0",
"d3-axis": "3.0.0",
"d3-scale": "4.0.2",
"d3-selection": "3.0.0",
"d3-shape": "3.0.0",
"d3-shape": "3.2.0",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-compat": "4.2.0",
@ -51,7 +51,7 @@
"git-rev-sync": "3.0.2",
"html2canvas": "1.4.1",
"imports-loader": "5.0.0",
"jasmine-core": "5.1.1",
"jasmine-core": "5.6.0",
"karma": "6.4.2",
"karma-chrome-launcher": "3.2.0",
"karma-cli": "2.0.0",
@ -64,14 +64,14 @@
"karma-webpack": "5.0.1",
"location-bar": "3.0.1",
"lodash": "4.17.21",
"marked": "12.0.0",
"mini-css-extract-plugin": "2.7.6",
"marked": "15.0.7",
"mini-css-extract-plugin": "2.9.2",
"moment": "2.30.1",
"moment-duration-format": "2.3.2",
"moment-timezone": "0.5.41",
"nano": "10.1.4",
"npm-run-all2": "6.1.2",
"nyc": "15.1.0",
"npm-run-all2": "7.0.2",
"nyc": "17.1.0",
"painterro": "1.2.87",
"plotly.js-basic-dist-min": "2.29.1",
"plotly.js-gl2d-dist-min": "2.20.0",
@ -79,21 +79,21 @@
"prettier-eslint": "16.3.0",
"printj": "1.3.1",
"resolve-url-loader": "5.0.0",
"sanitize-html": "2.12.1",
"sanitize-html": "2.15.0",
"sass": "1.71.1",
"sass-loader": "14.1.1",
"style-loader": "3.3.3",
"style-loader": "4.0.0",
"terser-webpack-plugin": "5.3.9",
"tiny-emitter": "2.1.0",
"typescript": "5.3.3",
"uuid": "9.0.1",
"uuid": "11.1.0",
"vue": "3.4.24",
"vue-eslint-parser": "9.4.2",
"vue-loader": "16.8.3",
"webpack": "5.90.3",
"webpack": "5.98.0",
"webpack-cli": "5.1.1",
"webpack-dev-server": "5.0.2",
"webpack-merge": "5.10.0"
"webpack-merge": "6.0.1"
},
"scripts": {
"clean": "rm -rf ./dist ./node_modules ./coverage ./html-test-results ./e2e/test-results ./.nyc_output ./e2e/.nyc_output",

View File

@ -344,12 +344,19 @@ export default {
},
beforeMount() {
this.marked = new Marked();
this.renderer = new this.marked.Renderer();
this.marked.use({
breaks: true,
extensions: [
{
name: 'link',
renderer: (options) => {
return this.validateLink(options);
}
}
]
});
},
mounted() {
const originalLinkRenderer = this.renderer.link;
this.renderer.link = this.validateLink.bind(this, originalLinkRenderer);
this.manageEmbedLayout = _.debounce(this.manageEmbedLayout, 400);
if (this.$refs.embedsWrapper) {
@ -437,10 +444,7 @@ export default {
}
},
convertMarkDownToHtml(text = '') {
let markDownHtml = this.marked.parse(text, {
breaks: true,
renderer: this.renderer
});
let markDownHtml = this.marked.parse(text);
markDownHtml = sanitizeHtml(markDownHtml, SANITIZATION_SCHEMA);
return markDownHtml;
},
@ -451,21 +455,19 @@ export default {
this.$refs.entryInput.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}
},
validateLink(originalLinkRenderer, href, title, text) {
validateLink(options) {
const { href, text } = options;
try {
const domain = new URL(href).hostname;
const urlIsWhitelisted = this.urlWhitelist.some((partialDomain) => {
return domain.endsWith(partialDomain);
});
if (!urlIsWhitelisted) {
return text;
}
const linkHtml = originalLinkRenderer.call(this.renderer, href, title, text);
const linkHtmlWithTarget = linkHtml.replace(
/^<a /,
'<a class="c-hyperlink" target="_blank"'
);
return linkHtmlWithTarget;
return `<a class="c-hyperlink" target="_blank" href="${href}">${text}</a>`;
} catch (error) {
// had error parsing this URL, just return the text
return text;