Skip to content
This repository
Browse code

Close #20

  • Loading branch information...
commit 4ddd1460cc56dd1cbed37319485246c826e81082 1 parent da25205
Mathias authored
17 .idea/inspectionProfiles/Project_Default.xml
... ... @@ -0,0 +1,17 @@
  1 +<component name="InspectionProjectProfileManager">
  2 + <profile version="1.0" is_locked="false">
  3 + <option name="myName" value="Project Default" />
  4 + <option name="myLocal" value="false" />
  5 + <inspection_tool class="Fix shebang" enabled="true" level="WARNING" enabled_by_default="true">/bin/sh#/bin/bash</inspection_tool>
  6 + <inspection_tool class="NullableProblems" enabled="false" level="WARNING" enabled_by_default="false">
  7 + <option name="REPORT_NULLABLE_METHOD_OVERRIDES_NOTNULL" value="true" />
  8 + <option name="REPORT_NOT_ANNOTATED_METHOD_OVERRIDES_NOTNULL" value="true" />
  9 + <option name="REPORT_NOTNULL_PARAMETER_OVERRIDES_NULLABLE" value="true" />
  10 + <option name="REPORT_NOT_ANNOTATED_PARAMETER_OVERRIDES_NOTNULL" value="true" />
  11 + <option name="REPORT_NOT_ANNOTATED_GETTER" value="true" />
  12 + <option name="REPORT_NOT_ANNOTATED_SETTER_PARAMETER" value="true" />
  13 + <option name="REPORT_ANNOTATION_NOT_PROPAGATED_TO_OVERRIDERS" value="true" />
  14 + <option name="REPORT_NULLS_PASSED_TO_NON_ANNOTATED_METHOD" value="true" />
  15 + </inspection_tool>
  16 + </profile>
  17 +</component>
7 .idea/inspectionProfiles/profiles_settings.xml
... ... @@ -0,0 +1,7 @@
  1 +<component name="InspectionProjectProfileManager">
  2 + <settings>
  3 + <option name="PROJECT_PROFILE" value="Project Default" />
  4 + <option name="USE_PROJECT_PROFILE" value="true" />
  5 + <version value="1.0" />
  6 + </settings>
  7 +</component>
6 src/main/java/org/pegdown/Parser.java
@@ -169,10 +169,12 @@ public Rule FencedCodeBlock() {
169 169 @Cached
170 170 public Rule CodeFence(Var<Integer> markerLength) {
171 171 return Sequence(
172   - NOrMore('~', 3),
  172 + FirstOf(NOrMore('~', 3), NOrMore('`', 3)),
173 173 (markerLength.isSet() && matchLength() == markerLength.get()) ||
174 174 (markerLength.isNotSet() && markerLength.set(matchLength())),
175   - Sp(), Newline()
  175 + Sp(),
  176 + ZeroOrMore(TestNot(Newline()), ANY), // GFM code type identifier
  177 + Newline()
176 178 );
177 179 }
178 180
1  src/test/java/org/pegdown/CustomPegDownTest.java
@@ -53,6 +53,7 @@ public void customPegDownTests() {
53 53 test("pegdown/Bug_in_0.8.5.1");
54 54 test("pegdown/Bug_in_0.8.5.4");
55 55 test("pegdown/Bug_in_1.0.0");
  56 + test("pegdown/GFM_Fenced_Code_Blocks");
56 57 test("pegdown/Linebreaks");
57 58 test("pegdown/Parens_in_URL");
58 59 test("pegdown/Quoted Blockquote");
7 src/test/resources/pegdown/GFM_Fenced_Code_Blocks.html
... ... @@ -0,0 +1,7 @@
  1 +<pre>
  2 +<code>
  3 +class Example(name: String) {
  4 + val field: Option[Int] = None
  5 +}
  6 +</code>
  7 +</pre>
5 src/test/resources/pegdown/GFM_Fenced_Code_Blocks.md
Source Rendered
... ... @@ -0,0 +1,5 @@
  1 +```scala
  2 +class Example(name: String) {
  3 + val field: Option[Int] = None
  4 +}
  5 +```

0 comments on commit 4ddd146

Please sign in to comment.
Something went wrong with that request. Please try again.