aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/render.js10
-rw-r--r--static/styles.css4
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/render.js b/lib/render.js
index ed60216..ef77f35 100644
--- a/lib/render.js
+++ b/lib/render.js
@@ -80,6 +80,14 @@ Render.prototype.emoji = function (emoji) {
}) : name
}
+function fixSymbols(str) {
+ // Dillo doesn't do fallback fonts, so specifically render fancy characters
+ // with Symbola
+ return str.replace(/[^\u0000-\u00ff]+/, function ($0) {
+ return '<span class="symbol">' + $0 + '</span>'
+ })
+}
+
Render.prototype.markdown = function (text, mentions) {
if (!text) return ''
var mentionsObj = this._mentions = {}
@@ -92,7 +100,7 @@ Render.prototype.markdown = function (text, mentions) {
})
var out = marked(String(text), this.markedOpts)
delete this._mentions
- return out
+ return fixSymbols(out)
}
Render.prototype.imageUrl = function (ref) {
diff --git a/static/styles.css b/static/styles.css
index 8a7129b..fd23b82 100644
--- a/static/styles.css
+++ b/static/styles.css
@@ -8,6 +8,10 @@ section {
padding: 1ex;
}
+.symbol {
+ font-family: Symbola;
+}
+
.ssb-post img {
max-width: 100%;
width: 640px;