Closed pm5 closed 11 years ago
a patch:
diff --git a/lib/zhdateparser.js b/lib/zhdateparser.js
index b8d8e4b..b15b38b 100644
--- a/lib/zhdateparser.js
+++ b/lib/zhdateparser.js
@@ -85,7 +85,7 @@ zhdateparser.parse = function(html){
// Add placeholder to help tokenize
html = html.replace(/((西元)?(\d\d{3}年?(-|-|~|~)\d\d{3}年)|\d\d{3}年)/g, "@@@$1"); // add placeholder for year
- html = html.replace(/(<\/sup>)/g, "$1`"); // add placeholder for year
+ //html = html.replace(/(<\/sup>)/g, "$1`"); // add placeholder for year
// Real parser
// Phase 1: Find summary start at year, end with specific html tag
jimmy 可以說明一下 ` 這個 placeholder 是做什麼用的嗎?
這是為了要在內文中,找出對應的外部索引,然後把索引提供給 timeline,timeline會自動針對外部的網頁做截圖
例如洪仲丘第一頁,因為找到索引,所以會去看他網頁,給timeline截圖 http://angry.g0v.tw/wiki/%E6%B4%AA%E4%BB%B2%E4%B8%98%E4%BA%8B%E4%BB%B6#1
json檔案中,「洪仲丘親生父親:仲丘跟他一起過父親節」的網址由此而來 http://angry.g0v.tw/wiki/%E6%B4%AA%E4%BB%B2%E4%B8%98%E4%BA%8B%E4%BB%B6.json
有更好的implement 方式,歡迎更改...
改成 ((。|;)(<sup.*?<\/sup>)*)
後面放 placeholder @@@
. 試了幾筆資料, 應該可以.
pm5++++~ server已經apply code了~可以用這個來重抓json看看結果~ http://angry.g0v.tw/wiki/OOO.json?nocache=1
我抓了一下文林苑,看來是正確的 http://angry.g0v.tw/wiki/%E6%96%87%E6%9E%97%E8%8B%91%E9%83%BD%E5%B8%82%E6%9B%B4%E6%96%B0%E7%88%AD%E8%AD%B0.json?nocache=1
http://angry.g0v.tw/wiki/%E6%96%87%E6%9E%97%E8%8B%91%E9%83%BD%E5%B8%82%E6%9B%B4%E6%96%B0%E7%88%AD%E8%AD%B0#9
parse 出來是:
原句是: