Directly use awk instead of xmllint - gophercgis - Collection of gopher CGI/DCGI for geomyidae
(HTM) hg clone https://bitbucket.org/iamleot/gophercgis
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) changeset 01c1a900f4d0a1992871b0bdcc6ad13a34258137
(DIR) parent ad0f37e7635f1859c9800f4ee1b722fd603be1b1
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Sat, 25 Aug 2018 23:06:31
Directly use awk instead of xmllint
xmllint seems problematic when UTF-8 characters appears at the beginning of the
<article>, they will end up encoded but also messed up... Directly use awk to
extract <article> and to completely avoid that.
Diffstat:
internazionale/article.cgi | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff -r ad0f37e7635f -r 01c1a900f4d0 internazionale/article.cgi
--- a/internazionale/article.cgi Sat Aug 25 23:02:26 2018 +0200
+++ b/internazionale/article.cgi Sat Aug 25 23:06:31 2018 +0200
@@ -7,7 +7,11 @@
extract_article()
{
- /usr/pkg/bin/xmllint --html --format --xpath '//article' - 2>/dev/null
+ awk '
+ /<article/,/<\/article>/ {
+ print
+ }
+ '
}