Revert "fix: style and misspell in docs"

This reverts commit a9c619d842db7e37aea525a77dac36cddd2d4924.
This commit is contained in:
1ambda 2016-11-07 14:22:48 +09:00
parent 73956e0736
commit 8cfb2c81a6
2 changed files with 12 additions and 14 deletions

View file

@ -47,10 +47,9 @@ The markdown interpreter provides github flavored markdown.
<img src="../assets/themes/zeppelin/img/docs-img/markdown-example-github-flavored-parser.png" width="70%" />
### Supported Plugins
### Supproted Plugins
- [YUML](http://yuml.me/)
- [Websequence](https://www.websequencediagrams.com/)
`pegdown` parser provides [YUML](http://yuml.me/) and [Websequence](https://www.websequencediagrams.com/) extensions
<img src="../assets/themes/zeppelin/img/docs-img/markdown-example-pegdown-parser.png" width="70%" />

View file

@ -42,17 +42,17 @@ import java.nio.charset.StandardCharsets;
*/
public class PegdownWebSequencelPlugin extends Parser implements BlockPluginParser {
private static final String URL_WEBSEQUENCE = "http://www.websequencediagrams.com";
public PegdownWebSequencelPlugin() {
super(PegdownParser.OPTIONS,
PegdownParser.PARSING_TIMEOUT_AS_MILLIS,
DefaultParseRunnerProvider);
}
public PegdownWebSequencelPlugin(Integer options, Long millis, ParseRunnerProvider provider,
public PegdownWebSequencelPlugin(Integer options,
Long maxParsingTimeInMillis,
ParseRunnerProvider parseRunnerProvider,
PegDownPlugins plugins) {
super(options, millis, provider, plugins);
super(options, maxParsingTimeInMillis, parseRunnerProvider, plugins);
}
public static final String TAG = "%%%";
@ -86,15 +86,14 @@ public class PegdownWebSequencelPlugin extends Parser implements BlockPluginPars
new TextNode(""))));
}
public static String createWebsequenceUrl(String style, String content) {
public static String createWebsequenceUrl(String style,
String content) {
style = StringUtils.defaultString(style, "default");
OutputStreamWriter writer = null;
BufferedReader reader = null;
String apiUrl = "";
try {
String query = new StringBuilder()
.append("style=")
@ -104,7 +103,7 @@ public class PegdownWebSequencelPlugin extends Parser implements BlockPluginPars
.append("&apiVersion=1")
.toString();
URL url = new URL(URL_WEBSEQUENCE);
URL url = new URL("http://www.websequencediagrams.com");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
writer = new OutputStreamWriter(conn.getOutputStream(), StandardCharsets.UTF_8);
@ -129,16 +128,16 @@ public class PegdownWebSequencelPlugin extends Parser implements BlockPluginPars
int end = json.indexOf("\"", start);
if (start != -1 && end != -1) {
apiUrl = URL_WEBSEQUENCE + "/" + json.substring(start, end);
return "http://www.websequencediagrams.com/" + json.substring(start, end);
}
} catch (IOException e) {
throw new RuntimeException("Failed to get proper response from websequencediagrams.com", e);
throw new RuntimeException("Failed to get proper response from websequencediagrams.com");
} finally {
IOUtils.closeQuietly(writer);
IOUtils.closeQuietly(reader);
}
return apiUrl;
return "";
}
@Override