mirror of
https://github.com/discourse/discourse.git
synced 2025-03-22 05:25:33 +08:00
FIX: do not cook local date without attributes
This commit is contained in:
parent
3bfd9698c7
commit
54a9073d94
@ -69,7 +69,7 @@ export function setup(helper) {
|
|||||||
|
|
||||||
helper.registerPlugin(md => {
|
helper.registerPlugin(md => {
|
||||||
const rule = {
|
const rule = {
|
||||||
matcher: /\[date(.*?)\]/,
|
matcher: /\[date(.+?)\]/,
|
||||||
onMatch: addLocalDate
|
onMatch: addLocalDate
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -26,4 +26,12 @@ describe PrettyText do
|
|||||||
|
|
||||||
expect(PrettyText.format_for_email(cooked)).to match_html(cooked_mail)
|
expect(PrettyText.format_for_email(cooked)).to match_html(cooked_mail)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'needs attributes to convert to a local date' do
|
||||||
|
cooked = PrettyText.cook <<~MD
|
||||||
|
[date]
|
||||||
|
MD
|
||||||
|
|
||||||
|
expect(cooked).to include("<p>[date]</p>")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user