cut off data urls in examples

This commit is contained in:
Tobias Koppers 2019-11-19 14:24:22 +01:00
parent 4047169096
commit 69a403f254
3 changed files with 8 additions and 3 deletions

View File

@ -128,7 +128,7 @@ function createImageElement(title, src) {
/*! runtime requirements: module */
/***/ ((module) => {
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3e%3ctitle%3eicon-square-small%3c/title%3e%3cpath fill='white' d='M300 .1L565 150v299.9L300 599.8 35 449.9V150z'/%3e%3cpath fill='%238ED6FB' d='M517.7 439.5L308.8 557.8v-92L439 394.1l78.7 45.4zm14.3-12.9V179.4l-76.4 44.1v159l76.4 44.1zM81.5 439.5l208.9 118.2v-92l-130.2-71.6-78.7 45.4zm-14.3-12.9V179.4l76.4 44.1v159l-76.4 44.1zm8.9-263.2L290.4 42.2v89l-137.3 75.5-1.1.6-75.9-43.9zm446.9 0L308.8 42.2v89L446 206.8l1.1.6 75.9-44z'/%3e%3cpath fill='%231C78C0' d='M290.4 444.8L162 374.1V234.2l128.4 74.1v136.5zm18.4 0l128.4-70.6v-140l-128.4 74.1v136.5zM299.6 303zm-129-85l129-70.9L428.5 218l-128.9 74.4-129-74.4z'/%3e%3c/svg%3e";
module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.or...3c/svg%3e";
/***/ })
/******/ ]);

File diff suppressed because one or more lines are too long

View File

@ -17,6 +17,7 @@ const runtimeModulesRegexp = /(\/\*{72}\/\n(?:\/(?:\*{6}|\*{72})\/.*\n)*\/\*{72}
const timeRegexp = /\s*Time: \d+ms/g;
const buildAtRegexp = /\s*Built at: .+/mg;
const hashRegexp = /Hash: [a-f0-9]+/g;
const dataUrlRegexp = /("data:[^"]+")/g;
exports.replaceBase = (template) => {
@ -41,6 +42,10 @@ exports.replaceBase = (template) => {
.replace(timeRegexp, "")
.replace(buildAtRegexp, "")
.replace(hashRegexp, "Hash: 0a1b2c3d4e5f6a7b8c9d")
.replace(dataUrlRegexp, function(match) {
if(match.length < 100) return match;
return match.slice(0, 50) + "..." + match.slice(-10);
})
.replace(/\.chunkhash\./g, ".[chunkhash].")
.replace(runtimeModulesRegexp, function(match, content) {
return "```\n\n<details><summary>"+