Skip to content

Commit

Permalink
Fix Java 7 compatibility that was broken with DOXIA-616
Browse files Browse the repository at this point in the history
* Replaced `\h` and `\v` escape sequences that are not supported in Java 7 regex *Pattern*
  • Loading branch information
bertysentry authored and elharo committed Jan 7, 2021
1 parent d679431 commit 82f421e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ public class MarkdownParser
private static final Pattern METADATA_SECTION_PATTERN = Pattern.compile(
"\\A^\\s*"
+ "(?:title|author|date|address|affiliation|copyright|email|keywords|language|phone|subtitle)"
+ "\\h*:\\h*\\V*\\h*$\\v+"
+ "(?:^\\h*[^:\\v]+\\h*:\\h*\\V*\\h*$\\v+)*",
+ "[ \\t]*:[ \\t]*[^\\r\\n]*[ \\t]*$[\\r\\n]+"
+ "(?:^[ \\t]*[^:\\r\\n]+[ \\t]*:[ \\t]*[^\\r\\n]*[ \\t]*$[\\r\\n]+)*",
Pattern.MULTILINE | Pattern.CASE_INSENSITIVE );

/**
* Regex that captures the key and value of a multimarkdown-style metadata entry.
*/
private static final Pattern METADATA_ENTRY_PATTERN = Pattern.compile(
"^\\h*([^:\\v]+?)\\h*:\\h*(\\V*)\\h*$",
"^[ \\t]*([^:\\r\\n]+?)[ \\t]*:[ \\t]*([^\\r\\n]*)[ \\t]*$",
Pattern.MULTILINE );

/**
Expand Down

0 comments on commit 82f421e

Please sign in to comment.