Mercurial > public > html2wiki
comparison src/org/nwoca/ssdt/tools/html2wiki/ReplaceTransformer.java @ 4:22ed6d93442c
Start modifying transformers to Confluence wiki syntax
author | smith@nwoca.org |
---|---|
date | Tue, 25 Jan 2011 21:59:31 -0500 |
parents | f8b1ea49d065 |
children | 8f23347884c0 |
comparison
equal
deleted
inserted
replaced
3:4417b025157e | 4:22ed6d93442c |
---|---|
14 } | 14 } |
15 public void apply(StringBuffer buffer) { | 15 public void apply(StringBuffer buffer) { |
16 Matcher matcher = replace.matcher(buffer); | 16 Matcher matcher = replace.matcher(buffer); |
17 | 17 |
18 boolean first = true; | 18 boolean first = true; |
19 while (matcher.find(first ? 0 : matcher.end())) { | 19 while (matcher.find(first ? 0 : matcher.start() + replacement.length())) { |
20 buffer.replace(matcher.start(),matcher.end(),replacement); | 20 buffer.replace(matcher.start(),matcher.end(),replacement); |
21 first = false; | 21 first = false; |
22 } | 22 } |
23 | |
24 } | 23 } |
25 | 24 |
26 public String toString() { | 25 public String toString() { |
27 return "Replace: " + replace.pattern() + " with " +replacement; | 26 return "Replace: " + replace.pattern() + " with " +replacement; |
28 } | 27 } |