jabber-xml-skip-tag-forward: improve the match regexp

Improvements to the scanning of XML tags and properties:
- Allow for white space after the parameter assignment sign (=).
- Don't allow a closing angle bracket (>) in parameter names.
- Skip trailing white space before looking for node termination (> or
  />).
- Match syntax table white space rather than enumerating the white space
  characters inline.
This commit is contained in:
David Edmondson 2016-01-21 09:14:15 +00:00 committed by Magnus Henoch
parent d5bfa1c62e
commit d4d7782741
1 changed files with 3 additions and 2 deletions

View File

@ -111,15 +111,16 @@ enough for us."
(if (search-forward "]]>" nil t)
(goto-char (match-end 0))
(throw 'unfinished nil)))
((looking-at "<\\([^ \t\n/>]+\\)\\([ \t\n]+[^=]+='[^']*'\\|[ \t\n]+[^=]+=\"[^\"]*\"\\)*")
((looking-at "<\\([^[:space:]/>]+\\)\\([[:space:]]+[^=>]+=[[:space:]]*'[^']*'\\|[[:space:]]+[^=>]+=[[:space:]]*\"[^\"]*\"\\)*")
(let ((node-name (match-string 1)))
(goto-char (match-end 0))
(skip-syntax-forward "\s-") ; Skip over trailing white space.
(cond
((looking-at "/>")
(goto-char (match-end 0))
t)
((looking-at ">")
(forward-char 1)
(goto-char (match-end 0))
(unless (and dont-recurse-into-stream (equal node-name "stream:stream"))
(loop
do (skip-chars-forward "^<")