mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +01:00
Limit small image rendering to just the avatar images
This commit is contained in:
parent
70e550250a
commit
fecf6700d2
2 changed files with 10 additions and 3 deletions
11
src/khoj/interface/web/assets/markdown-it.min.js
vendored
11
src/khoj/interface/web/assets/markdown-it.min.js
vendored
|
@ -3228,8 +3228,15 @@
|
||||||
// Encode attributes, e.g. `<img src="foo"`
|
// Encode attributes, e.g. `<img src="foo"`
|
||||||
result += this.renderAttrs(token);
|
result += this.renderAttrs(token);
|
||||||
|
|
||||||
// Add a class name for all tokens, e.g. `<img class="foo"`
|
if (token.tag === "img" && token.attrs) {
|
||||||
result += ' class="md-level"';
|
for (var i = 0; i < token.attrs.length; i++) {
|
||||||
|
if (token.attrs[i][0] === "src") {
|
||||||
|
if (token.attrs[i][1].includes("avatar")) {
|
||||||
|
result += ' class="md-avatar"';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Add a slash for self-closing tags, e.g. `<img src="foo" /`
|
// Add a slash for self-closing tags, e.g. `<img src="foo" /`
|
||||||
if (token.nesting === 0 && options.xhtmlOut) {
|
if (token.nesting === 0 && options.xhtmlOut) {
|
||||||
result += " /";
|
result += " /";
|
||||||
|
|
|
@ -380,7 +380,7 @@
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
img.md-level {
|
img.md-avatar {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
|
Loading…
Reference in a new issue