Fix to generate valid feed/atom

parent 3cb49f75
......@@ -42,7 +42,7 @@
(updated ,updated-time)
(content (@ (type "xhtml"))
(div (@ (xmlns "http://www.w3.org/1999/xhtml"))
,(post-content post))))))
,(fix-decode (post-content post)))))))
(define (posts->atom)
(map atom-entry (get-all-posts #:latest-top? #t)))
......
......@@ -17,6 +17,7 @@
(define-module (colt utils)
#:use-module (web uri)
#:use-module (srfi srfi-19)
#:use-module (artanis irregex)
#:use-module (rnrs)
#:export (date-comparator
date-before?
......@@ -29,7 +30,8 @@
timestamp->readable-date
trim-content
record-type->list
gen-proper-url-name))
gen-proper-url-name
fix-decode))
(define (record-type->list rt)
(let ((v (record-type-field-names (record-rtd rt))))
......@@ -83,3 +85,9 @@
(string-downcase
(string-append (strftime "%Y/%m/%d/" (localtime timestamp))
(uri-encode url-name)))))
(define (fix-decode s)
(irregex-replace/all
" "
(irregex-replace/all "<p><br></p>" s "")
"&#160;"))
/*
@licstart The following is the entire license notice for the
JavaScript code in this page.
@licstart The following is the entire license notice for the
JavaScript code in this page.
Copyright (C) 2019 Mu Lei known as NalaGinrut <mulei@gnu.org>
Copyright (C) 2019 Mu Lei known as NalaGinrut <mulei@gnu.org>
The JavaScript code in this page is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
The JavaScript code in this page is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this page.
*/
@licend The above is the entire license notice
for the JavaScript code in this page.
*/
var children_nodes;
var quill;
var url_name;
......@@ -117,6 +117,9 @@ function intro_submit() {
let tags = "";
let status = "publish";
// Quill will embed redundnat <br> which breaks XML validation, we fix it here.
article_content.replace("<p><br></p>", "");
let submit_button = document.getElementById("submit-button");
submit_button.innerText = "Submiting...";
submit_button.disabled = true;
......@@ -163,6 +166,9 @@ function edit_submit() {
submit_button.innerText = "Submiting...";
submit_button.disabled = true;
// Quill will embed redundnat <br> which breaks XML validation, we fix it here.
article_content.replace("<p><br></p>", "");
$(document).ready(function () {
$.ajax({
type: "POST",
......@@ -209,6 +215,8 @@ function submit_post() {
/* Remove redundant BOM */
article_content = article_content.replace(/[\u200B-\u200D\uFEFF]/g, '');
// Quill will embed redundnat <br> which breaks XML validation, we fix it here.
article_content.replace("<p><br></p>", "");
$(document).ready(function () {
$.ajax({
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment