OSDN Git Service

fixed paragraph bug with "ONLY" IE!
authorelixirel <elixirel@users.sourceforge.jp>
Sat, 6 Jun 2009 04:24:43 +0000 (13:24 +0900)
committerelixirel <elixirel@users.sourceforge.jp>
Sat, 6 Jun 2009 04:24:43 +0000 (13:24 +0900)
js/lunardial/feedblog_gen.js

index 1e18d81..8a76b6a 100644 (file)
@@ -4,7 +4,7 @@
  * @copyright 2009 FeedBlog Project (http://sourceforge.jp/projects/feedblog/)
  * @author Kureha Hisame (http://lunardial.sakura.ne.jp/) & Yui Naruse (http://airemix.com/)
  * @since 2009/06/03
- * @version 0.1.0.0
+ * @version 0.5.0.0
  */
 // Feex XMLの<content>要素で、<br>を使用しているか?
 var inputValidateMode = 1;
@@ -40,7 +40,7 @@ function applyChange(){
         entry.published = dateRfc3339;
         entry.updated = dateRfc3339;
         entry.link = pageAddr + "#" + entry.id;
-        entry.content = document.getElementById("entry_stdin").value;
+        entry.content = document.getElementById("entry_stdin").value.replace(/\r\n/g, "\n");
         entryList.unshift(entry);
         
         refleshEntrylistBox();
@@ -48,7 +48,7 @@ function applyChange(){
     else {
         entryList[editIndex].title = document.getElementById("entry_title").value;
         entryList[editIndex].updated = getDate();
-        entryList[editIndex].content = document.getElementById("entry_stdin").value;
+        entryList[editIndex].content = document.getElementById("entry_stdin").value.replace(/\r\n/g, "\n");
     }
     
     document.getElementById("stdout").value = toXml(feedInfo, entryList);
@@ -202,10 +202,8 @@ function entryLoader(index){
         editIndex = -1;
     }
     else {
-        var temp_content = entryList[index].content;
-        alert(temp_content);
         document.getElementById("entry_title").value = entryList[index].title;
-        document.getElementById("entry_stdin").value = temp_content;
+        document.getElementById("entry_stdin").value = entryList[index].content;
         editIndex = index;
     }
 }
@@ -336,11 +334,10 @@ function xmlAttrContentEscape(str){
 
 /**
  * XMLの逆エスケープを行う関数
- * バグあり!&amp;の処理がおかしい
  * @param {String} str 逆エスケープを行う文字列
  */
 function xmlAttrContentUnescape(str){
-    return str.replace(/&nbsp;/g, " ").replace(/&quot;/g, '"').replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&amp;/g, "&");
+    return str.replace.replace(/&quot;/g, '"').replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&amp;/g, "&");
 }
 
 /**