| @@ -32,6 +32,12 @@ body { | |||
| grid-area: posts; | |||
| overflow-y: scroll; | |||
| } | |||
| .post .text p { | |||
| margin: 0; | |||
| } | |||
| .post .text p:first-child { | |||
| display: inline; | |||
| } | |||
| .actions { | |||
| grid-area: actions; | |||
| display: grid; | |||
| @@ -2,6 +2,8 @@ | |||
| <html> | |||
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | |||
| <script src="https://unpkg.com/mithril/mithril.min.js"></script> | |||
| <script src="https://unpkg.com/marked/marked.min.js"></script> | |||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.0.2/purify.min.js"></script> | |||
| <script src="/pico.js" defer></script> | |||
| <link rel="stylesheet" href="/pico.css" /> | |||
| <body>PicoChat requires JS</body> | |||
| @@ -7,6 +7,10 @@ const State = { | |||
| rpcs: {}, | |||
| media: {}, | |||
| } | |||
| const markedOptions = { | |||
| breaks: true, | |||
| } | |||
| marked.setOptions(markedOptions) | |||
| /* | |||
| * | |||
| @@ -212,7 +216,7 @@ const Chat = { | |||
| State.posts.map(post => m('.post', {oncreate: scrollIntoView}, | |||
| m('.ts', prettyTime(post.ts)), | |||
| m('.source', post.source || '~'), | |||
| m('.text', post.value), | |||
| m('.text', m.trust(DOMPurify.sanitize(marked(post.value)))), | |||
| )), | |||
| ), | |||
| m('.actions', | |||