Skip to content

Commit ccc5a39

Browse files
authored
[ENG-9609] P14.3 - Image sizing in wiki rules/format have changed (#772)
- Ticket: [ENG-9609] - Feature flag: n/a ## Summary of Changes 1. Added support for image resizing in wiki.
1 parent 20fd5b5 commit ccc5a39

File tree

5 files changed

+36
-7
lines changed

5 files changed

+36
-7
lines changed

jest.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ module.exports = {
2424
},
2525
],
2626
},
27-
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$|@ngxs|@angular|@ngrx|parse5|entities|chart.js)'],
27+
transformIgnorePatterns: [
28+
'node_modules/(?!.*\\.mjs$|@ngxs|@angular|@ngrx|parse5|entities|chart.js|@mdit|@citation-js|@traptitech|@sentry|@primeng|@newrelic)',
29+
],
2830
testEnvironment: 'jsdom',
2931
moduleFileExtensions: ['ts', 'js', 'html', 'json', 'mjs'],
3032
coverageDirectory: 'coverage',

package-lock.json

Lines changed: 23 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"@citation-js/core": "^0.7.18",
4545
"@citation-js/plugin-csl": "^0.7.18",
4646
"@fortawesome/fontawesome-free": "^6.7.2",
47+
"@mdit/plugin-img-size": "0.22.3",
4748
"@newrelic/browser-agent": "^1.301.0",
4849
"@ngx-translate/core": "^16.0.4",
4950
"@ngx-translate/http-loader": "^16.0.1",

src/app/shared/components/markdown/markdown.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ChangeDetectionStrategy, Component, computed, inject, input, Signal } from '@angular/core';
22
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
33

4+
import { legacyImgSize } from '@mdit/plugin-img-size';
45
import markdownItKatex from '@traptitech/markdown-it-katex';
56
import MarkdownIt from 'markdown-it';
67
import markdownItVideo from 'markdown-it-video';
@@ -37,6 +38,7 @@ export class MarkdownComponent {
3738
.use(markdownItKatex, {
3839
output: 'mathml',
3940
throwOnError: false,
40-
});
41+
})
42+
.use(legacyImgSize);
4143
}
4244
}

src/styles/components/md-editor.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,13 @@
9797
list-style-type: decimal;
9898
}
9999
}
100+
101+
img {
102+
max-width: 100%;
103+
height: auto;
104+
}
100105
}
106+
101107
.md-footer {
102108
display: none;
103109
}

0 commit comments

Comments
 (0)