comparison yahtml.el @ 573:9e07513fc2ef dev

Do not escape URL when it has triple `%XX's
author HIROSE Yuuji <yuuji@gentei.org>
date Wed, 11 Sep 2019 09:27:10 +0900
parents e3209b30680c
children d4831b3672f8
comparison
equal deleted inserted replaced
572:714f3527b4a1 573:9e07513fc2ef
1 ;;; yahtml.el --- Yet Another HTML mode -*- coding: sjis -*- 1 ;;; yahtml.el --- Yet Another HTML mode -*- coding: sjis -*-
2 ;;; (c) 1994-2017 by HIROSE Yuuji [yuuji(@)yatex.org] 2 ;;; (c) 1994-2019 by HIROSE Yuuji [yuuji(@)yatex.org]
3 ;;; $Id$ 3 ;;; $Id$
4 4
5 (defconst yahtml-revision-number "1.80" 5 (defconst yahtml-revision-number "1.80.1"
6 "Revision number of running yahtml.el") 6 "Revision number of running yahtml.el")
7 7
8 ;;; Commentary: 8 ;;; Commentary:
9 9
10 ;;;[Installation] 10 ;;;[Installation]
1082 "Translate reserved chars to URL encoded string." 1082 "Translate reserved chars to URL encoded string."
1083 (let ((p 0) (target "") 1083 (let ((p 0) (target "")
1084 (ask (eq yahtml-escape-chars 'ask))) 1084 (ask (eq yahtml-escape-chars 'ask)))
1085 (cond 1085 (cond
1086 ((null yahtml-escape-chars) str) 1086 ((null yahtml-escape-chars) str)
1087 ((string-match "%[0-9A-F][0-9A-F]%[0-9A-F][0-9A-F]%[0-9A-F][0-9A-F]" str)
1088 str)
1087 (t 1089 (t
1088 (while (and (string< "" str) 1090 (while (and (string< "" str)
1089 (setq p (string-match yahtml-unsafe-chars-regexp str))) 1091 (setq p (string-match yahtml-unsafe-chars-regexp str)))
1090 (if (and ask (y-or-n-p (format "Escape char [%c] of `%s'" 1092 (if (and ask (y-or-n-p (format "Escape char [%c] of `%s'"
1091 (aref str p) (substring str 0 (1+ p))))) 1093 (aref str p) (substring str 0 (1+ p)))))

yatex.org