Make image and attachment embedding syntax more consistent #274
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
This PR makes changes to the
[Image:]
and[Attachment:]
embed syntaxes so they behave more consistently with the older!!n
(image) and!@n
(attachment) syntaxes.In particular,
[Image:]
and[Attachment:]
only worked when preceded by two newline characters (\n\n
). Whereas!!n
and!@n
only needed to be preceded by one newline character (\n
).Before
For example, this would work when embedding with the
!!n
syntax:But this would not work with the
[Image:]
syntax:After
Both examples above work as expected.
They both produce HTML output like:
Why
We've recently introduced support for
[Image:]
syntax in Whitehall, and will soon be adding support for[Attachment:]
too. We quickly received feedback from users that the new image embedding syntax wasn't working – and it turns out it was because they were used to embedding images using!!n
syntax, which only needed one newline character.To resolve the inconsistency, we've decided to bring the syntaxes in line by making the newer
[Image:]
and[Attachment:]
syntaxes more lenient as users were expecting.Trello: https://trello.com/c/FxDTL9Ic/1272-update-image-syntax-so-it-behaves-similar-to-images-added-in-whitehall-previously-no-line-break-needed