]> code.delx.au - gnu-emacs/commitdiff
Encode the shr tests files with trailing white space
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 24 Apr 2016 13:18:22 +0000 (15:18 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 24 Apr 2016 13:18:29 +0000 (15:18 +0200)
.gitattributes
test/data/shr/li-empty.txt
test/lisp/net/shr-tests.el

index 24fe4c7acfaac20c9adef508e677c501418b5fcd..13e58a87e9fe38630c764ab1c657ac9c53c8a0bc 100644 (file)
@@ -33,9 +33,6 @@ test/etags/html-src/algrthms.html whitespace=cr-at-eol
 # The upstream maintainer does not want to remove trailing whitespace.
 doc/misc/texinfo.tex -whitespace=blank-at-eol
 
-# The shr test files can have trailing whitespace.
-test/data/shr/*.txt -whitespace=blank-at-eol
-
 # Some files should not be treated as text when diffing or merging.
 *.cur binary
 *.gpg binary
index 8320bc0097be2041dd4f14445bee8a30d112456c..906fd8df8b3e6898f7b3c9d99451e6c9818f02ab 100644 (file)
@@ -1,3 +1,3 @@
-1 
-2 
-3 
+1%20
+2%20
+3%20
index 6606ec58151dc17cb6fd30650472cd4ea13648df..ab6fc93d1a057cc811e8a82d75aeac3c82a687e7 100644 (file)
@@ -36,6 +36,9 @@
       (cons (buffer-substring-no-properties (point-min) (point-max))
             (with-temp-buffer
               (insert-file-contents (format "data/shr/%s.txt" name))
+              (while (re-search-forward "%\\([0-9A-F][0-9A-F]\\)" nil t)
+                (replace-match (string (string-to-number (match-string 1) 16))
+                               t t))
               (buffer-string))))))
 
 (ert-deftest rendering ()