git://git.nikiroo.be
/
fanfix-jexer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
37fdbde
)
FimfictionApi: improve bbcode description handling
author
Niki Roo
<niki@nikiroo.be>
Thu, 13 Jul 2017 16:29:13 +0000
(18:29 +0200)
committer
Niki Roo
<niki@nikiroo.be>
Thu, 13 Jul 2017 16:29:13 +0000
(18:29 +0200)
src/be/nikiroo/fanfix/supported/FimfictionApi.java
patch
|
blob
|
blame
|
history
diff --git
a/src/be/nikiroo/fanfix/supported/FimfictionApi.java
b/src/be/nikiroo/fanfix/supported/FimfictionApi.java
index 1594d5e18f365d14bfeb227e057bdec07c528bbf..59b593ec7aecedea5cb24c4f91b10f6819b172d6 100644
(file)
--- a/
src/be/nikiroo/fanfix/supported/FimfictionApi.java
+++ b/
src/be/nikiroo/fanfix/supported/FimfictionApi.java
@@
-159,7
+159,15
@@
class FimfictionApi extends BasicSupport {
@Override
protected String getDesc(URL source, InputStream in) {
- return getKeyJson(json, 0, "type", "story", "description");
+ String desc = getKeyJson(json, 0, "type", "story", "description");
+
+ // TODO: if the description becomes available in html, use it
+ desc = desc.replace("\\r\\n", "<br/>");
+ desc = desc.replace("[i]", "_").replace("[/i]", "_")
+ .replace("[b]", "*").replace("[/b]", "*");
+ desc = desc.replaceAll("\\[[^\\]]*\\]", "");
+
+ return desc;
}
@Override