diff options
author | Hannes Rosenögger <123haynes@gmail.com> | 2015-03-20 00:20:45 +0300 |
---|---|---|
committer | Hannes Rosenögger <123haynes@gmail.com> | 2015-03-20 00:20:45 +0300 |
commit | 623f6c5f099de6500361bc558f681b18e1689c74 (patch) | |
tree | 8ea9a37237cfdd250d522f52b9ff87f91643e7df /doc | |
parent | 012411817b277e0115378288150c1044fb712741 (diff) | |
parent | fad71576f91beb4aae8e8482465a696cdfc3b222 (diff) |
Merge branch 'fix-underscore-notes' into 'master'
Fix cross-references that contain underscores
### What does this MR do?
Cross-references that contain underscores confuse the Markdown renderer and don't work properly. For example:
1. In `myacct/project_one#456`, add a comment that includes a reference to `myacct/project_two#123`.
2. The comment in `myacct/project_one#456` links correctly.
3. The system note in `myacct/project_two#123` is incorrectly linked as:
`mentioned in issue myacct/projectone#456_`
This MR removes the use of the `_` character in the system notes to prevent Markdown confusion.
See a full discussion in #1160.
### Are there points in the code the reviewer needs to double check?
To preserve backwards compatibility with existing system notes, there is a SQL wildcard match for notes having underscores. This seemed safer than migrating all notes.
### Why was this MR needed?
In an ideal world, the Markdown parser would be able to handle references containing underscores with or without escape sequences. However, there are a number of issues:
1. RedCarpet's parser for emphasis block is pretty dumb: it treats `#` as a word break and thus even the `intra_word_emphasis` flag has no effect.
2. The parser is in C and can't be changed easily.
3. There is no way to insert an escape sequence for emphasis blocks.
The only way around this is to switch to something like CommonMark, which does support escape sequences.
### What are the relevant issue numbers / [Feature requests](http://feedback.gitlab.com/)?
Issue #1160
### Screenshots
Before:
![Screen_Shot_2015-03-19_at_1.39.29_AM](https://gitlab.com/gitlab-org/gitlab-ce/uploads/a1db4b96c0df2f10d9855ed5abe976ca/Screen_Shot_2015-03-19_at_1.39.29_AM.png)
After:
![Screen_Shot_2015-03-19_at_1.39.35_AM](https://gitlab.com/gitlab-org/gitlab-ce/uploads/189a062c2d19645eec1782ac1f0d4f2f/Screen_Shot_2015-03-19_at_1.39.35_AM.png)
See merge request !385
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/merge_requests.md | 2 | ||||
-rw-r--r-- | doc/api/notes.md | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md index 1f3fd26a241..6a272539e45 100644 --- a/doc/api/merge_requests.md +++ b/doc/api/merge_requests.md @@ -375,7 +375,7 @@ Parameters: } }, { - "note": "_Status changed to closed_", + "note": "Status changed to closed", "author": { "id": 11, "username": "admin", diff --git a/doc/api/notes.md b/doc/api/notes.md index c22e493562a..ee2f9fa0eac 100644 --- a/doc/api/notes.md +++ b/doc/api/notes.md @@ -21,7 +21,7 @@ Parameters: [ { "id": 302, - "body": "_Status changed to closed_", + "body": "Status changed to closed", "attachment": null, "author": { "id": 1, |