FIX: do not cook local date without attributes

This commit is contained in:
Joffrey JAFFEUX 2018-05-24 10:56:04 +02:00 committed by GitHub
parent 3bfd9698c7
commit 54a9073d94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -69,7 +69,7 @@ export function setup(helper) {
helper.registerPlugin(md => {
const rule = {
matcher: /\[date(.*?)\]/,
matcher: /\[date(.+?)\]/,
onMatch: addLocalDate
};

View File

@ -26,4 +26,12 @@ describe PrettyText do
expect(PrettyText.format_for_email(cooked)).to match_html(cooked_mail)
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