Merge pull request #285 from christianbundy/vanilla-markdown

Vanilla markdown
This commit is contained in:
Cinnamon 2020-03-06 11:57:08 -08:00 committed by GitHub
commit e7c38e3ec5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 13 deletions

View File

@ -1,18 +1,22 @@
# Oasis
Oasis is a **free, open-source, peer-to-peer social application** that helps you follow friends and discover new ones on [Secure Scuttlebutt (SSB)][ssb].
Oasis is a **free, open-source, peer-to-peer social application** that helps
you follow friends and discover new ones on [Secure Scuttlebutt (SSB)][ssb].
### 🦀 Powered by SSB
**🦀 Powered by SSB.**
You're the center of your own distributed network. Online or offline, SSB works
anywhere that you are. Follow the people you want to see and never worry about
spam again. Migrate your data to another SSB app any time you want.
You're the center of your own distributed network. Online or offline, SSB works anywhere that you are. Follow the people you want to see and never worry about spam again. Migrate your data to another SSB app any time you want.
**🌐 Bring your own browser.**
Use your favorite web browser to read and write messages to the people you care
about. Oasis runs a small HTTP server on your own computer, so you don't need
to worry about adding another Electron app to your computer.
### 🌐 Bring your own browser
Use your favorite web browser to read and write messages to the people you care about. Oasis runs a small HTTP server on your own computer, so you don't need to worry about adding another Electron app to your computer.
### 🏰 Just HTML and CSS
No browser JavaScript! Oasis has strict security rules that prevent any JavaScript from running in your browser, which helps us make Oasis accessible and easy to improve.
**🏰 Just HTML and CSS.**
No browser JavaScript! Oasis has strict security rules that prevent any
JavaScript from running in your browser, which helps us make Oasis accessible
and easy to improve.
## Example
@ -26,7 +30,8 @@ It will then pop open a browser window for you.
![Screenshot of Oasis](./docs/screenshot.png)
Use `oasis --help` to get configuration options. You can change the default values with a custom [configuration](./docs/configuring.md).
Use `oasis --help` to get configuration options. You can change the default
values with a custom [configuration](./docs/configuring.md).
## Installation

View File

@ -34,6 +34,7 @@
"koa-router": "^7.4.0",
"koa-static": "^5.0.0",
"lodash": "^4.17.11",
"markdown-it": "^8.4.2",
"open": "7.0.0",
"pretty-ms": "^5.0.0",
"pull-paramap": "^1.2.2",

View File

@ -1,9 +1,10 @@
"use strict";
const debug = require("debug")("oasis");
const ssbMarkdown = require("ssb-markdown");
const highlightJs = require("highlight.js");
const MarkdownIt = require("markdown-it");
const {
a,
article,
@ -44,6 +45,8 @@ const {
const lodash = require("lodash");
const markdown = require("./markdown");
const md = new MarkdownIt();
const i18nBase = require("./i18n");
let i18n = null;
let selectedLanguage = null;
@ -692,7 +695,7 @@ exports.threadView = ({ messages }) =>
template(messages.map(msg => post({ msg })));
exports.markdownView = ({ text }) => {
const rawHtml = ssbMarkdown.block(text);
const rawHtml = md.render(text);
return template(section({ class: "message" }, { innerHTML: rawHtml }));
};