Skip to content

Build your personal knowledge base with Trilium Notes

Merge origin/main into feat/fun-take1

perfectra1n6593470289d2
diff --cc apps/client/src/widgets/highlights_list.ts
index d4e8fbda76,512e8eff30..6557478e37
--- a/apps/client/src/widgets/highlights_list.ts
+++ b/apps/client/src/widgets/highlights_list.ts
@@@ -276,11 -180,8 +201,8 @@@ export default class HighlightsListWidg
if (prevEndIndex !== -1 && startIndex === prevEndIndex) {
// If the previous element is connected to this element in HTML, then concatenate them into one.
- $highlightsList.children().last().append(subHtml);
+ $highlightsList.children().last().append(DOMPurify.sanitize(subHtml, HIGHLIGHT_PURIFY_CONFIG));
} else {
- // TODO: can't be done with $(subHtml).text()?
- //Can’t remember why regular expressions are used here, but modified to $(subHtml).text() works as expected
- //const hasText = [...subHtml.matchAll(/(?<=^|>)[^><]+?(?=<|$)/g)].map(matchTmp => matchTmp[0]).join('').trim();
const hasText = $(subHtml).text().trim();
if (hasText) {
diff --cc apps/server/src/routes/api/options.ts
index c9940b9875,e39cf7dc7f..ecab49c0c9
--- a/apps/server/src/routes/api/options.ts
+++ b/apps/server/src/routes/api/options.ts
@@@ -209,12 -194,7 +211,8 @@@ function getUserThemes()
return ret;
}
- function getSupportedLocales() {
- return getLocales();
- }
-
-function isAllowed(name: string) {
+/** Check if an option can be read by the client (GET responses). */
+function isReadable(name: string) {
return (ALLOWED_OPTIONS as Set<string>).has(name)
|| name.startsWith("keyboardShortcuts")
|| name.endsWith("Collapsed")