mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Update MD037/no-space-in-emphasis to handle "***"/"___" (fixes #218).
This commit is contained in:
parent
c4f77e021d
commit
caf21fb392
2 changed files with 30 additions and 2 deletions
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
const { addErrorContext, forEachInlineChild } = require("../helpers");
|
const { addErrorContext, forEachInlineChild } = require("../helpers");
|
||||||
|
|
||||||
const leftSpaceRe = /(?:^|\s)(\*\*?|__?)\s.*[^\\]\1/g;
|
const leftSpaceRe = /(?:^|\s)(\*\*?\*?|__?_?)\s.*[^\\]\1/g;
|
||||||
const rightSpaceRe = /(?:^|[^\\])(\*\*?|__?).+\s\1(?:\s|$)/g;
|
const rightSpaceRe = /(?:^|[^\\])(\*\*?\*?|__?_?).+\s\1(?:\s|$)/g;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "MD037", "no-space-in-emphasis" ],
|
"names": [ "MD037", "no-space-in-emphasis" ],
|
||||||
|
|
|
||||||
|
|
@ -4,26 +4,38 @@ Line with *Normal emphasis*
|
||||||
|
|
||||||
Line with **Normal strong**
|
Line with **Normal strong**
|
||||||
|
|
||||||
|
Line with ***Normal strong and emphasis***
|
||||||
|
|
||||||
Line with _Normal emphasis_
|
Line with _Normal emphasis_
|
||||||
|
|
||||||
Line with __Normal strong__
|
Line with __Normal strong__
|
||||||
|
|
||||||
|
Line with ___Normal strong and emphasis___
|
||||||
|
|
||||||
Broken * emphasis * with spaces in {MD037}
|
Broken * emphasis * with spaces in {MD037}
|
||||||
|
|
||||||
Broken ** strong ** with spaces in {MD037}
|
Broken ** strong ** with spaces in {MD037}
|
||||||
|
|
||||||
|
Broken *** strong and emphasis *** with spaces in {MD037}
|
||||||
|
|
||||||
Broken _ emphasis _ with spaces in {MD037}
|
Broken _ emphasis _ with spaces in {MD037}
|
||||||
|
|
||||||
Broken __ strong __ with spaces in {MD037}
|
Broken __ strong __ with spaces in {MD037}
|
||||||
|
|
||||||
|
Broken ___ strong and emphasis ___ with spaces in {MD037}
|
||||||
|
|
||||||
Mixed *ok emphasis* and * broken emphasis * {MD037}
|
Mixed *ok emphasis* and * broken emphasis * {MD037}
|
||||||
|
|
||||||
Mixed **ok strong** and ** broken strong ** {MD037}
|
Mixed **ok strong** and ** broken strong ** {MD037}
|
||||||
|
|
||||||
|
Mixed ***ok strong and emphasis*** and *** broken strong and emphasis *** {MD037}
|
||||||
|
|
||||||
Mixed _ok emphasis_ and _ broken emphasis _ {MD037}
|
Mixed _ok emphasis_ and _ broken emphasis _ {MD037}
|
||||||
|
|
||||||
Mixed __ok strong__ and __ broken strong __ {MD037}
|
Mixed __ok strong__ and __ broken strong __ {MD037}
|
||||||
|
|
||||||
|
Mixed ___ok strong and emphasis___ and ___ broken strong and emphasis ___ {MD037}
|
||||||
|
|
||||||
Mixed *ok emphasis* **ok strong** * broken emphasis * {MD037}
|
Mixed *ok emphasis* **ok strong** * broken emphasis * {MD037}
|
||||||
|
|
||||||
Multiple * broken emphasis * _ broken emphasis _ {MD037}
|
Multiple * broken emphasis * _ broken emphasis _ {MD037}
|
||||||
|
|
@ -40,30 +52,46 @@ The same goes for words* with asterisks* after them.
|
||||||
|
|
||||||
** Strong** with left space {MD037}
|
** Strong** with left space {MD037}
|
||||||
|
|
||||||
|
*** Strong and emphasis*** with left space {MD037}
|
||||||
|
|
||||||
_ Emphasis_ with left space {MD037}
|
_ Emphasis_ with left space {MD037}
|
||||||
|
|
||||||
__ Strong__ with left space {MD037}
|
__ Strong__ with left space {MD037}
|
||||||
|
|
||||||
|
___ Strong and emphasis___ with left space {MD037}
|
||||||
|
|
||||||
*Emphasis * with right space {MD037}
|
*Emphasis * with right space {MD037}
|
||||||
|
|
||||||
**Strong ** with right space {MD037}
|
**Strong ** with right space {MD037}
|
||||||
|
|
||||||
|
***Strong and emphasis *** with right space {MD037}
|
||||||
|
|
||||||
_Emphasis _ with right space {MD037}
|
_Emphasis _ with right space {MD037}
|
||||||
|
|
||||||
__Strong __ with right space {MD037}
|
__Strong __ with right space {MD037}
|
||||||
|
|
||||||
|
___Strong and emphasis ___ with right space {MD037}
|
||||||
|
|
||||||
{MD037} Left space * emphasis*
|
{MD037} Left space * emphasis*
|
||||||
|
|
||||||
{MD037} Left space ** strong**
|
{MD037} Left space ** strong**
|
||||||
|
|
||||||
|
{MD037} Left space *** strong and emphasis***
|
||||||
|
|
||||||
{MD037} Left space _ emphasis_
|
{MD037} Left space _ emphasis_
|
||||||
|
|
||||||
{MD037} Left space __ strong__
|
{MD037} Left space __ strong__
|
||||||
|
|
||||||
|
{MD037} Left space ___ strong and emphasis___
|
||||||
|
|
||||||
{MD037} Right space *emphasis *
|
{MD037} Right space *emphasis *
|
||||||
|
|
||||||
{MD037} Right space **strong **
|
{MD037} Right space **strong **
|
||||||
|
|
||||||
|
{MD037} Right space ***strong and emphasis ***
|
||||||
|
|
||||||
{MD037} Right space _emphasis _
|
{MD037} Right space _emphasis _
|
||||||
|
|
||||||
{MD037} Right space __strong __
|
{MD037} Right space __strong __
|
||||||
|
|
||||||
|
{MD037} Right space ___strong and emphasis ___
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue