Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Close #20

  • Loading branch information...
commit 4ddd1460cc56dd1cbed37319485246c826e81082 1 parent da25205
@sirthias authored
View
17 .idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,17 @@
+<component name="InspectionProjectProfileManager">
+ <profile version="1.0" is_locked="false">
+ <option name="myName" value="Project Default" />
+ <option name="myLocal" value="false" />
+ <inspection_tool class="Fix shebang" enabled="true" level="WARNING" enabled_by_default="true">/bin/sh#/bin/bash</inspection_tool>
+ <inspection_tool class="NullableProblems" enabled="false" level="WARNING" enabled_by_default="false">
+ <option name="REPORT_NULLABLE_METHOD_OVERRIDES_NOTNULL" value="true" />
+ <option name="REPORT_NOT_ANNOTATED_METHOD_OVERRIDES_NOTNULL" value="true" />
+ <option name="REPORT_NOTNULL_PARAMETER_OVERRIDES_NULLABLE" value="true" />
+ <option name="REPORT_NOT_ANNOTATED_PARAMETER_OVERRIDES_NOTNULL" value="true" />
+ <option name="REPORT_NOT_ANNOTATED_GETTER" value="true" />
+ <option name="REPORT_NOT_ANNOTATED_SETTER_PARAMETER" value="true" />
+ <option name="REPORT_ANNOTATION_NOT_PROPAGATED_TO_OVERRIDERS" value="true" />
+ <option name="REPORT_NULLS_PASSED_TO_NON_ANNOTATED_METHOD" value="true" />
+ </inspection_tool>
+ </profile>
+</component>
View
7 .idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,7 @@
+<component name="InspectionProjectProfileManager">
+ <settings>
+ <option name="PROJECT_PROFILE" value="Project Default" />
+ <option name="USE_PROJECT_PROFILE" value="true" />
+ <version value="1.0" />
+ </settings>
+</component>
View
6 src/main/java/org/pegdown/Parser.java
@@ -169,10 +169,12 @@ public Rule FencedCodeBlock() {
@Cached
public Rule CodeFence(Var<Integer> markerLength) {
return Sequence(
- NOrMore('~', 3),
+ FirstOf(NOrMore('~', 3), NOrMore('`', 3)),
(markerLength.isSet() && matchLength() == markerLength.get()) ||
(markerLength.isNotSet() && markerLength.set(matchLength())),
- Sp(), Newline()
+ Sp(),
+ ZeroOrMore(TestNot(Newline()), ANY), // GFM code type identifier
+ Newline()
);
}
View
1  src/test/java/org/pegdown/CustomPegDownTest.java
@@ -53,6 +53,7 @@ public void customPegDownTests() {
test("pegdown/Bug_in_0.8.5.1");
test("pegdown/Bug_in_0.8.5.4");
test("pegdown/Bug_in_1.0.0");
+ test("pegdown/GFM_Fenced_Code_Blocks");
test("pegdown/Linebreaks");
test("pegdown/Parens_in_URL");
test("pegdown/Quoted Blockquote");
View
7 src/test/resources/pegdown/GFM_Fenced_Code_Blocks.html
@@ -0,0 +1,7 @@
+<pre>
+<code>
+class Example(name: String) {
+ val field: Option[Int] = None
+}
+</code>
+</pre>
View
5 src/test/resources/pegdown/GFM_Fenced_Code_Blocks.md
@@ -0,0 +1,5 @@
+```scala
+class Example(name: String) {
+ val field: Option[Int] = None
+}
+```
Please sign in to comment.
Something went wrong with that request. Please try again.