diff --git a/apps/ssb/tf-utils.js b/apps/ssb/tf-utils.js index 74d8a93e..de09a431 100644 --- a/apps/ssb/tf-utils.js +++ b/apps/ssb/tf-utils.js @@ -1,9 +1,44 @@ import * as linkify from './commonmark-linkify.js'; import * as hashtagify from './commonmark-hashtag.js'; + +function image(node, entering) { + if (node.firstChild?.type === 'text' && + node.firstChild.literal.startsWith('video:')) { + if (entering) { + this.lit(''); + } + } else { + if (entering) { + if (this.disableTags === 0) { + if (this.options.safe && potentiallyUnsafe(node.destination)) { + this.lit('');
+				} else {
+					this.lit('<img src='); + } + } + } +} + export function markdown(md) { var reader = new commonmark.Parser({safe: true}); var writer = new commonmark.HtmlRenderer(); + writer.image = image; var parsed = reader.parse(md || ''); parsed = linkify.transform(parsed); parsed = hashtagify.transform(parsed); diff --git a/apps/todo/script.js b/apps/todo/script.js index b8cdf391..00720b51 100644 --- a/apps/todo/script.js +++ b/apps/todo/script.js @@ -114,13 +114,12 @@ class TodoListElement extends LitElement { @change=${event => self.input_change(event, item)} @keydown=${event => self.input_keydown(event, item)} @blur=${x => self.input_blur(item)}> - self.remove_item(item)}>x + self.remove_item(item)} style="cursor: pointer">❎ `; } else { return html`
self.handle_check(x, item)}> self.editing = index}>${item.text} - self.remove_item(item)} style="cursor: pointer">❎
`; } } @@ -175,7 +174,8 @@ class TodoListElement extends LitElement { return html`
${name} - ${(this.items || []).map(x => self.render_item(x))} + ${(this.items || []).filter(item => !item.x).map(x => self.render_item(x))} + ${(this.items || []).filter(item => item.x).map(x => self.render_item(x))}