Skip to content

🐛 Bug: Escape special characters for markdown reporter #2306

Description

@frantic1048

If I put any character has a special meaning in markdown, into the describe message. Run Mocha with -R md .The output markdown will have wrong semantic with any special character in messages.

Just write test like this:

describe('***', function() {
  describe('\\\\', function() {
    it('>>> should be escaped');
  });
});

Markdown would have:

# TOC
   - [***](#)
     - [\\](#-)
<a name=""></a>

<a name=""></a>
# ***
<a name="-"></a>
## \\

The special characters changed markdown output's semantic, finally brings out a strange look.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: accepting prsMocha can use your help with this one!type: buga defect, confirmed by a maintainer

    Type

    No type

    Projects

    Status
    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions