mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: allow advanced specification of excerpts for posts
Previously users could control excerpt with `<span class='excerpt'>` in Markdown, this is somewhat limited for plugins that need to define this across a section. This adds support for DIV as well
This commit is contained in:
parent
9248ad1905
commit
5c17e46274
@ -183,6 +183,7 @@ const DEFAULT_LIST = [
|
||||
"small",
|
||||
"span[lang]",
|
||||
"span.excerpt",
|
||||
"div.excerpt",
|
||||
"span.hashtag",
|
||||
"span.mention",
|
||||
"strike",
|
||||
|
@ -270,6 +270,21 @@ describe PostCreator do
|
||||
}.to_not change { topic.excerpt }
|
||||
end
|
||||
|
||||
it 'supports custom excerpts' do
|
||||
raw = <<~MD
|
||||
<div class='excerpt'>
|
||||
I am
|
||||
|
||||
a custom excerpt
|
||||
</div>
|
||||
|
||||
testing
|
||||
MD
|
||||
post = create_post(raw: raw)
|
||||
|
||||
expect(post.excerpt).to eq("I am\na custom excerpt")
|
||||
end
|
||||
|
||||
it 'creates post stats' do
|
||||
|
||||
Draft.set(user, 'new_topic', 0, "test")
|
||||
|
Loading…
Reference in New Issue
Block a user