mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 02:50:00 +08:00
FEATURE: site setting for Markdown typographer
It ships anyway with markdown.it so we might as well expose it
This commit is contained in:
parent
0d62420cbe
commit
4c5109ff5b
|
@ -133,7 +133,7 @@ export function setup(opts, siteSettings, state) {
|
|||
breaks: opts.discourse.features.newline,
|
||||
xhtmlOut: false,
|
||||
linkify: true,
|
||||
typographer: false
|
||||
typographer: siteSettings.enable_markdown_typographer
|
||||
});
|
||||
|
||||
setupHoister(opts.engine);
|
||||
|
|
|
@ -1024,6 +1024,7 @@ en:
|
|||
flag_sockpuppets: "If a new user replies to a topic from the same IP address as the new user who started the topic, flag both of their posts as potential spam."
|
||||
|
||||
traditional_markdown_linebreaks: "Use traditional linebreaks in Markdown, which require two trailing spaces for a linebreak."
|
||||
enable_markdown_typographer: "Use basic typography rules to improve text readability of paragraphs of text, replaces (c) (tm) etc, with symbols, reduces number of question marks and so on"
|
||||
allow_html_tables: "Allow tables to be entered in Markdown using HTML tags. TABLE, THEAD, TD, TR, TH will be whitelisted (requires full rebake on all old posts containing tables)"
|
||||
post_undo_action_window_mins: "Number of minutes users are allowed to undo recent actions on a post (like, flag, etc)."
|
||||
must_approve_users: "Staff must approve all new user accounts before they are allowed to access the site. WARNING: enabling this for a live site will revoke access for existing non-staff users!"
|
||||
|
|
|
@ -497,6 +497,9 @@ posting:
|
|||
traditional_markdown_linebreaks:
|
||||
client: true
|
||||
default: false
|
||||
enable_markdown_typographer:
|
||||
client: true
|
||||
default: false
|
||||
allow_html_tables:
|
||||
client: true
|
||||
default: false
|
||||
|
|
|
@ -615,6 +615,13 @@ HTML
|
|||
expect(PrettyText.cook("# banana")).to include("\u25a0\u25a0")
|
||||
end
|
||||
|
||||
it 'supports typographer' do
|
||||
SiteSetting.enable_markdown_typographer = true
|
||||
expect(PrettyText.cook('(tm)')).to eq('<p>™</p>')
|
||||
SiteSetting.enable_markdown_typographer = false
|
||||
expect(PrettyText.cook('(tm)')).to eq('<p>(tm)</p>')
|
||||
end
|
||||
|
||||
it 'handles onebox correctly' do
|
||||
# we expect 2 oneboxes
|
||||
expect(PrettyText.cook("http://a.com\nhttp://b.com").split("onebox").length).to eq(3)
|
||||
|
|
Loading…
Reference in New Issue
Block a user