summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremie Bresson2012-10-16 04:26:46 (EDT)
committer Jeremie Bresson2012-10-16 04:26:46 (EDT)
commitc725568aee7459ea3a0904a0631c8ae1053c503a (patch)
treea18f1e374d93a8e4379d277e3bf6340d2be54c08
parentd4707d60861b6d50546ade4e541a34ed89c0fe72 (diff)
downloadorg.eclipse.mylyn.docs-c725568aee7459ea3a0904a0631c8ae1053c503a.zip
org.eclipse.mylyn.docs-c725568aee7459ea3a0904a0631c8ae1053c503a.tar.gz
org.eclipse.mylyn.docs-c725568aee7459ea3a0904a0631c8ae1053c503a.tar.bz2
391850: [MediaWiki] Bold and Italic marker do not work with space.refs/changes/90/8190/2
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=391850 Change-Id: Ifa19b293927d920f99c492f46930fbc06a5ec364
-rw-r--r--org.eclipse.mylyn.wikitext.mediawiki.core/src/org/eclipse/mylyn/internal/wikitext/mediawiki/core/phrase/SimpleWrappedPhraseModifier.java3
-rw-r--r--org.eclipse.mylyn.wikitext.tests/src/org/eclipse/mylyn/wikitext/mediawiki/core/MediaWikiLanguageTest.java36
2 files changed, 37 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.wikitext.mediawiki.core/src/org/eclipse/mylyn/internal/wikitext/mediawiki/core/phrase/SimpleWrappedPhraseModifier.java b/org.eclipse.mylyn.wikitext.mediawiki.core/src/org/eclipse/mylyn/internal/wikitext/mediawiki/core/phrase/SimpleWrappedPhraseModifier.java
index be1da86..ffeacc4 100644
--- a/org.eclipse.mylyn.wikitext.mediawiki.core/src/org/eclipse/mylyn/internal/wikitext/mediawiki/core/phrase/SimpleWrappedPhraseModifier.java
+++ b/org.eclipse.mylyn.wikitext.mediawiki.core/src/org/eclipse/mylyn/internal/wikitext/mediawiki/core/phrase/SimpleWrappedPhraseModifier.java
@@ -7,6 +7,7 @@
*
* Contributors:
* David Green - initial API and implementation
+ * Jeremie Bresson - Bug 391850
*******************************************************************************/
package org.eclipse.mylyn.internal.wikitext.mediawiki.core.phrase;
@@ -76,7 +77,7 @@ public class SimpleWrappedPhraseModifier extends PatternBasedElement {
return quotedStartDelimiter + //
"(?!" + quotedStartDelimiterLastChar + ")" + // //$NON-NLS-1$//$NON-NLS-2$
- "([^\\s" + quotedEndDelimiter + "]+|\\S(?:.*?\\S)?)" + // conten //$NON-NLS-1$ //$NON-NLS-2$
+ "([^" + quotedEndDelimiter + "]+|\\S(?:.*?\\S)?)" + // content //$NON-NLS-1$ //$NON-NLS-2$
quotedEndDelimiter;
}
diff --git a/org.eclipse.mylyn.wikitext.tests/src/org/eclipse/mylyn/wikitext/mediawiki/core/MediaWikiLanguageTest.java b/org.eclipse.mylyn.wikitext.tests/src/org/eclipse/mylyn/wikitext/mediawiki/core/MediaWikiLanguageTest.java
index f18faa2..fb6f248 100644
--- a/org.eclipse.mylyn.wikitext.tests/src/org/eclipse/mylyn/wikitext/mediawiki/core/MediaWikiLanguageTest.java
+++ b/org.eclipse.mylyn.wikitext.tests/src/org/eclipse/mylyn/wikitext/mediawiki/core/MediaWikiLanguageTest.java
@@ -7,7 +7,7 @@
*
* Contributors:
* David Green - initial API and implementation
- * Jeremie Bresson - Bug 381506, 381912
+ * Jeremie Bresson - Bug 381506, 381912, 391850
*******************************************************************************/
package org.eclipse.mylyn.wikitext.mediawiki.core;
@@ -122,12 +122,46 @@ public class MediaWikiLanguageTest extends TestCase {
assertTrue(Pattern.compile("<body><p><b>aa</b>bb</p></body>").matcher(html).find());
}
+ public void testBoldWithWhitespace() {
+ //Bug 391850
+ String html;
+
+ html = parser.parseToHtml("normal ''' bold text''' normal");
+ TestUtil.println(html);
+ assertTrue(html.contains("<body><p>normal <b> bold text</b> normal</p></body>"));
+
+ html = parser.parseToHtml("normal '''bold text ''' normal");
+ TestUtil.println(html);
+ assertTrue(html.contains("<body><p>normal <b>bold text </b> normal</p></body>"));
+
+ html = parser.parseToHtml("normal ''' bold text ''' normal");
+ TestUtil.println(html);
+ assertTrue(html.contains("<body><p>normal <b> bold text </b> normal</p></body>"));
+ }
+
public void testItalic() {
String html = parser.parseToHtml("normal ''italic text'' normal");
TestUtil.println(html);
assertTrue(Pattern.compile("<body><p>normal <i>italic text</i> normal</p></body>").matcher(html).find());
}
+ public void testItalicWithWhitespace() {
+ //Bug 391850
+ String html;
+
+ html = parser.parseToHtml("normal '' italic text'' normal");
+ TestUtil.println(html);
+ assertTrue(html.contains("<body><p>normal <i> italic text</i> normal</p></body>"));
+
+ html = parser.parseToHtml("normal ''italic text '' normal");
+ TestUtil.println(html);
+ assertTrue(html.contains("<body><p>normal <i>italic text </i> normal</p></body>"));
+
+ html = parser.parseToHtml("normal '' italic text '' normal");
+ TestUtil.println(html);
+ assertTrue(html.contains("<body><p>normal <i> italic text </i> normal</p></body>"));
+ }
+
public void testHeadings() {
for (int x = 1; x <= 6; ++x) {
String delimiter = repeat(x, "=");