diff --git a/webapp/package.json b/webapp/package.json index 366522d..3b0c2dd 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -11,6 +11,7 @@ "dependencies": { "compression": "^1.7.1", "date-fns": "^2.16.1", + "dompurify": "^2.2.2", "isomorphic-fetch": "^3.0.0", "lodash": "^4.17.20", "node-fetch": "^2.6.1", diff --git a/webapp/src/components/Article.svelte b/webapp/src/components/Article.svelte index 12da966..56d872a 100644 --- a/webapp/src/components/Article.svelte +++ b/webapp/src/components/Article.svelte @@ -1,13 +1,41 @@ @@ -94,7 +92,9 @@ class="navigation-link" aria-current={segment === undefined ? 'page' : undefined} rel="prefetch" - href=".">News + href="."> + {#if segment === undefined}Qot.{:else}← News feed{/if} +
- diff --git a/webapp/src/components/StoryInfo.svelte b/webapp/src/components/StoryInfo.svelte index 3881646..63e41f2 100644 --- a/webapp/src/components/StoryInfo.svelte +++ b/webapp/src/components/StoryInfo.svelte @@ -6,10 +6,10 @@ {#if story.author && story.author_link} by - {story.author} -{:else if story.author}by {story.author}{/if} + {story.author} +{:else if story.author}by {/if} on -{story.source} +{story.source} {#if story.score}• {story.score} points{/if} {#if story.num_comments} • diff --git a/webapp/static/global.css b/webapp/static/global.css index 0e2b9a9..649af28 100644 --- a/webapp/static/global.css +++ b/webapp/static/global.css @@ -9,25 +9,11 @@ body { margin-bottom: 50vh; } -h1, -h2, -h3, -h4, -h5, -h6 { - margin: 0 0 0.5em 0; - font-weight: 400; - line-height: 1.2; -} - -h1 { - font-size: 2em; -} - a { color: inherit; } +pre, code { font-family: menlo, inconsolata, monospace; font-size: calc(1em - 2px); @@ -36,3 +22,8 @@ code { padding: 0.2em 0.4em; border-radius: 2px; } + +pre { + max-width: 100%; + overflow: auto; +} diff --git a/webapp/yarn.lock b/webapp/yarn.lock index 56a3188..0cb41a9 100644 --- a/webapp/yarn.lock +++ b/webapp/yarn.lock @@ -779,6 +779,11 @@ domain-browser@^1.1.1: resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== +dompurify@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.2.2.tgz#cb8c2b1a2f3c8a0b565127504ae4eedec176a972" + integrity sha512-BsGR4nDLaC5CNBnyT5I+d5pOeaoWvgVeg6Gq/aqmKYWMPR07131u60I80BvExLAJ0FQEIBQ1BTicw+C5+jOyrg== + duplexify@^3.4.2, duplexify@^3.6.0: version "3.7.1" resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309"