Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ docs, but these are some you might care to know about:
(and write it to a file in `INSTANCE_PATH`) if one doesn't exist.
* `SILICON_EDITOR`: When set to `textarea`, this disables the CodeMirror text
editor when editing pages and uses a standard textarea element instead.
* `MD_HARD_WRAP`: When set to `true`, all line breaks are converted to `<br>`
tags. By default, you must suffix a line with two spaces (` `) to get a
`<br>`.

To initialize the database after the configuration settings have been set,
run the following command. It will create an `instance` directory in the root
Expand Down
2 changes: 2 additions & 0 deletions silicon/render_md.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from flask import url_for
from mistune import create_markdown, HTMLRenderer
from mistune.util import safe_entity
Expand Down Expand Up @@ -111,6 +112,7 @@ def md_renderer(text):
"""Render a Markdown document into HTML."""

markdown = create_markdown(
hard_wrap=(os.getenv('MD_HARD_WRAP') or "").lower() == "true",
renderer=CustomRenderer(escape=False),
plugins=[
'strikethrough',
Expand Down