Skip to content

Exclamation mark should be escaped if followed by link #931

@dbolton

Description

@dbolton

Describe the bug
When an exclamation mark is followed by a link (e.g. "Word!Link") the exclamation mark should be escaped in the markdown source. Otherwise the next time the file is opened the exclamation mark disappears from display and the link is interpreted as an image

To Reproduce
Steps to reproduce the behavior:

  1. Select and copy the following text: Word!Link
  2. Open a markdown file in Nextcloud
  3. Paste
  4. Close markdown file
  5. Reopen markdown file

Expected behavior
When you reopen the file in step five you should still see Word!Link. Instead you see WordImage.

In the markdown source the text should have been saved as Word\![Link](http://example.com)

Use case
When writing footnotes, links come right at the end of a sentence. If the sentence ends with an exclamation mark, a footnote link may follow.

Client details:

  • OS: Windows
  • Browser: Firefox (developer edition)
  • Version: 49
  • Device: Desktop
Server details

Text app version: 2.0.0

Operating system: Ubuntu

Web server: Nginx

Database: mysql

PHP version: 7.2.31

Nextcloud version: 18.0.6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions