Merge branch 'ah/userdiff-markdown'
The userdiff patterns for Markdown documents have been added. * ah/userdiff-markdown: userdiff: support Markdown
This commit is contained in:
@ -824,6 +824,8 @@ patterns are available:
|
|||||||
|
|
||||||
- `java` suitable for source code in the Java language.
|
- `java` suitable for source code in the Java language.
|
||||||
|
|
||||||
|
- `markdown` suitable for Markdown documents.
|
||||||
|
|
||||||
- `matlab` suitable for source code in the MATLAB and Octave languages.
|
- `matlab` suitable for source code in the MATLAB and Octave languages.
|
||||||
|
|
||||||
- `objc` suitable for source code in the Objective-C language.
|
- `objc` suitable for source code in the Objective-C language.
|
||||||
|
@ -38,6 +38,7 @@ diffpatterns="
|
|||||||
golang
|
golang
|
||||||
html
|
html
|
||||||
java
|
java
|
||||||
|
markdown
|
||||||
matlab
|
matlab
|
||||||
objc
|
objc
|
||||||
pascal
|
pascal
|
||||||
|
6
t/t4018/markdown-heading-indented
Normal file
6
t/t4018/markdown-heading-indented
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
Indented headings are allowed, as long as the indent is no more than 3 spaces.
|
||||||
|
|
||||||
|
### RIGHT
|
||||||
|
|
||||||
|
- something
|
||||||
|
- ChangeMe
|
17
t/t4018/markdown-heading-non-headings
Normal file
17
t/t4018/markdown-heading-non-headings
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
Headings can be right next to other lines of the file:
|
||||||
|
# RIGHT
|
||||||
|
Indents of four or more spaces make a code block:
|
||||||
|
|
||||||
|
# code comment, not heading
|
||||||
|
|
||||||
|
If there's no space after the final hash, it's not a heading:
|
||||||
|
|
||||||
|
#hashtag
|
||||||
|
|
||||||
|
Sequences of more than 6 hashes don't make a heading:
|
||||||
|
|
||||||
|
####### over-enthusiastic heading
|
||||||
|
|
||||||
|
So the detected heading should be right up at the start of this file.
|
||||||
|
|
||||||
|
ChangeMe
|
@ -79,6 +79,9 @@ PATTERNS("java",
|
|||||||
"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
|
"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
|
||||||
"|[-+*/<>%&^|=!]="
|
"|[-+*/<>%&^|=!]="
|
||||||
"|--|\\+\\+|<<=?|>>>?=?|&&|\\|\\|"),
|
"|--|\\+\\+|<<=?|>>>?=?|&&|\\|\\|"),
|
||||||
|
PATTERNS("markdown",
|
||||||
|
"^ {0,3}#{1,6}[ \t].*",
|
||||||
|
"[^<>= \t]+"),
|
||||||
PATTERNS("matlab",
|
PATTERNS("matlab",
|
||||||
/*
|
/*
|
||||||
* Octave pattern is mostly the same as matlab, except that '%%%' and
|
* Octave pattern is mostly the same as matlab, except that '%%%' and
|
||||||
|
Reference in New Issue
Block a user