• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Moxkiriyaプロジェクト事前開発用の作業部屋


Commit MetaInfo

Revisioneb27190d0749569aa031ee382caf84fc6794ce10 (tree)
Zeit2018-08-30 22:09:41
AutorHarold_Andoh <andolloyd@gmai...>
CommiterHarold_Andoh

Log Message

[Moxkiriya7]

  • BoldとItalicがネストした場合に正しく処理できていなかったバグを修正

Ändern Zusammenfassung

Diff

--- a/src/com/wiki/standalone/moxkiriya/parser/inlineparser/WikiBoldInlineParser.java
+++ b/src/com/wiki/standalone/moxkiriya/parser/inlineparser/WikiBoldInlineParser.java
@@ -43,29 +43,7 @@ public class WikiBoldInlineParser extends WikiInlineParserBase {
4343 .matcher(line);
4444
4545 if(startMatcher.find() == true) {
46- /*
47- * PATTERN_STARTの開始位置を取得
48- */
49- int startIndex = startMatcher.start();
50-
51- /*
52- * PATTERN_ENDの開始位置を取得
53- */
54- String subline = line.substring(startIndex);
55- Matcher boldEndMatcher = Pattern.compile(WikiBoldInlineParser.PATTERN_END)
56- .matcher(subline);
57- Matcher italicEndMatcher = Pattern.compile(WikiBoldInlineParser.PATTERN_ITALIC_END)
58- .matcher(subline);
59-
60- if( (boldEndMatcher.find() == true)
61- && (italicEndMatcher.find() == true)) {
62- int boldEndIndex = boldEndMatcher.start();
63- int italicEndIndex = italicEndMatcher.start();
64-
65- isMatch = (boldEndIndex <= italicEndIndex)
66- ? true
67- : false;
68- }
46+ isMatch = true;
6947 }
7048
7149 return isMatch;
@@ -84,7 +62,10 @@ public class WikiBoldInlineParser extends WikiInlineParserBase {
8462 @Override
8563 public String deleteWikiToken(String line) {
8664 String deleteTop = line.replaceFirst(WIKI_TOKEN, "");
87- return deleteTop.substring(0, deleteTop.lastIndexOf(WIKI_TOKEN));
65+ if(deleteTop.contains(WIKI_TOKEN) == true) {
66+ deleteTop = deleteTop.substring(0, deleteTop.lastIndexOf(WIKI_TOKEN));
67+ }
68+ return deleteTop;
8869 }
8970
9071 @Override
--- a/src/com/wiki/standalone/moxkiriya/parser/inlineparser/WikiInlineParserBase.java
+++ b/src/com/wiki/standalone/moxkiriya/parser/inlineparser/WikiInlineParserBase.java
@@ -107,6 +107,9 @@ public abstract class WikiInlineParserBase implements WikiInlineParser {
107107 if(endMatcher.find() == true) {
108108 matchString = startSub.substring(0, endMatcher.end());
109109 }
110+ else {
111+ matchString = startSub;
112+ }
110113 }
111114
112115 if(matchString != null) {
--- a/src/com/wiki/standalone/moxkiriya/parser/inlineparser/WikiItalicInlineParser.java
+++ b/src/com/wiki/standalone/moxkiriya/parser/inlineparser/WikiItalicInlineParser.java
@@ -40,21 +40,7 @@ public class WikiItalicInlineParser extends WikiInlineParserBase {
4040 .matcher(line);
4141
4242 if(startMatcher.find() == true) {
43- /*
44- * PATTERN_STARTの開始位置を取得
45- */
46- int startIndex = startMatcher.start();
47-
48- /*
49- * PATTERN_ENDの開始位置を取得
50- */
51- String subline = line.substring(startIndex);
52- Matcher endMatcher = Pattern.compile(WikiItalicInlineParser.PATTERN_END)
53- .matcher(subline);
54-
55- if(endMatcher.find() == true) {
56- isMatch = true;
57- }
43+ isMatch = true;
5844 }
5945
6046 return isMatch;
@@ -73,7 +59,10 @@ public class WikiItalicInlineParser extends WikiInlineParserBase {
7359 @Override
7460 public String deleteWikiToken(String line) {
7561 String deleteTop = line.replaceFirst(WIKI_TOKEN, "");
76- return deleteTop.substring(0, deleteTop.lastIndexOf(WIKI_TOKEN));
62+ if(deleteTop.contains(WIKI_TOKEN) == true) {
63+ deleteTop = deleteTop.substring(0, deleteTop.lastIndexOf(WIKI_TOKEN));
64+ }
65+ return deleteTop;
7766 }
7867
7968 @Override