* bug#46181: 28.0.50; html-mode wrong indentation when using source element
@ 2021-01-29 21:23 Mauro Aranda
2021-01-29 21:28 ` Mauro Aranda
0 siblings, 1 reply; 3+ messages in thread
From: Mauro Aranda @ 2021-01-29 21:23 UTC (permalink / raw)
To: 46181
Starting with emacs -Q, visit a new .html file and write:
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Test</title>
</head>
<body>
<picture>
<source srcset="wide.png" media="(min-width: 800px)">
<source srcset="medium.png" media="(min-width: 600px)">
<img src="narrow.png">
</picture>
</body>
</html>
C-x h TAB
Check that the source tag and the img tag are indented badly. My
expectation was to see them at the same indentation level.
Move point to the picture closing tag and press TAB. Emacs says:
"Unclosed tag <source>", which isn't right:
https://html.spec.whatwg.org/multipage/embedded-content.html#the-source-element
In GNU Emacs 28.0.50 (build 12, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10)
of 2021-01-29 built on tbb-desktop
Repository revision: 840b1c66b4a686763c9288de8efb7ec48ccf06da
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Ubuntu 18.04.5 LTS
Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG
LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SOUND THREADS
TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB
Important settings:
value of $LC_MONETARY: es_AR.UTF-8
value of $LC_NUMERIC: es_AR.UTF-8
value of $LC_TIME: es_AR.UTF-8
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: VC dir
Minor modes in effect:
magit-auto-revert-mode: t
global-git-commit-mode: t
async-bytecomp-package-mode: t
shell-dirtrack-mode: t
global-ede-mode: t
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow emacsbug term ehelp face-remap magit-patch magit-subtree
magit-ediff ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help
ediff-init ediff-util magit-submodule magit-obsolete magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log which-func imenu magit-diff magit-core
magit-autorevert autorevert filenotify magit-margin magit-transient
magit-process magit-mode git-commit transient magit-git magit-section
magit-utils crm with-editor async-bytecomp async shell server dash
shr-color qp rmailmm mailalias smtpmail sendmail mail-extr gnutls
network-stream url-http url-gw nsm url-cache url-auth ispell log-edit
disp-table sgml-mode rx org-element avl-tree org-habit org-agenda ol-eww
eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect
gnus-search eieio-opt gnus-art mm-uu mml2015 mm-view mml-smime smime dig
gnus-sum shr kinsoku svg dom gnus-group gnus-undo gnus-start gnus-dbus
gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time
gnus-spec gnus-int gnus-range message rmc puny rfc822 mml mml-sec epa
epg epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader gnus-win ol-docview doc-view jka-compr
image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m misearch multi-isearch
semantic/lex-spp ede/emacs semantic/db semantic/util-modes semantic/util
semantic semantic/tag semantic/lex semantic/fw mode-local bug-reference
smerge-mode diff whitespace add-log log-view pcvs-util cl-extra
help-mode vc-mtn vc-hg vc-git diff-mode vc-bzr vc-src vc-sccs vc-svn
vc-cvs vc-rcs vc-dir ewoc dired-aux ede/dired edmacro kmacro cus-start
cus-load org-capture org-refile solarized-dark-high-contrast-theme
solarized-palettes solarized solarized-faces color init-ext init-emms
dbus emms-librefm-stream emms-librefm-scrobbler emms-playlist-limit
emms-volume emms-volume-mixerctl emms-volume-pulse emms-volume-amixer
emms-i18n emms-history emms-score emms-stream-info
emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon
emms-browser sort emms-playlist-sort emms-last-played emms-player-xine
emms-player-mpd tq emms-playing-time emms-lyrics emms-url emms-streams
emms-show-all emms-tag-editor emms-mark emms-mode-line emms-cache
emms-info-exiftool emms-info-tinytag emms-info-metaflac
emms-info-opusinfo emms-info-ogginfo emms-info-mp3info emms-info
emms-later-do emms-playlist-mode emms-player-vlc emms-player-mpv
emms-player-mplayer emms-player-simple emms-source-playlist
emms-source-file locate dired dired-loaddefs emms-setup emms emms-compat
init-gnus gnus nnheader gnus-util init-org org-clock org ob ob-tangle
ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint
org-pcomplete pcomplete org-list org-faces org-entities org-version
ob-emacs-lisp ob-core ob-eval org-table ol org-keys org-compat advice
org-macs org-loaddefs format-spec find-func cal-menu calendar
cal-loaddefs init-social newsticker newst-treeview tree-widget
newst-plainview newst-reader newst-ticker newst-backend iso8601
time-date xml derived init-cedet ede/speedbar ede/files ede ede/detect
ede/base ede/auto ede/source eieio-base eieio-speedbar speedbar ezimage
dframe eieio-custom wid-edit cedet init-octave init-rmail undigest rmail
rmail-loaddefs rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
init-vc vc vc-dispatcher init-cc-mode init-c init-yasnippet init-eshell
eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module
esh-groups esh-util init-lisp slime compile text-property-search etags
fileloop generator xref project arc-mode archive-mode noutline outline
easy-mmode pp comint ansi-color ring hyperspec thingatpt init-elisp
init-global finder-inf init-package slime-autoloads info package
easymenu browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)
Memory information:
((conses 16 571716 32407)
(symbols 48 44442 1)
(strings 32 185324 8612)
(string-bytes 1 5498763)
(vectors 16 76154)
(vector-slots 8 1604427 39065)
(floats 8 572 466)
(intervals 56 3969 547)
(buffers 984 35))
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#46181: 28.0.50; html-mode wrong indentation when using source element
2021-01-29 21:23 bug#46181: 28.0.50; html-mode wrong indentation when using source element Mauro Aranda
@ 2021-01-29 21:28 ` Mauro Aranda
2021-01-30 6:48 ` Lars Ingebrigtsen
0 siblings, 1 reply; 3+ messages in thread
From: Mauro Aranda @ 2021-01-29 21:28 UTC (permalink / raw)
To: 46181
[-- Attachment #1: Type: text/plain, Size: 82 bytes --]
tags 46181 patch
quit
Looks like "source" needs to be added to sgml-empty-tags.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch --]
[-- Type: text/x-patch, Size: 1222 bytes --]
From da4659abc3b4622d74f36adfd4803e60c48b5203 Mon Sep 17 00:00:00 2001
From: Mauro Aranda <maurooaranda@gmail.com>
Date: Fri, 29 Jan 2021 10:28:10 -0300
Subject: [PATCH] Add source to sgml-empty-tags
* lisp/textmodes/sgml-mode.el (html-mode): Add "source" as an empty
tag to fix indentation when this element is present. (Bug#46181)
---
lisp/textmodes/sgml-mode.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 8465e82b02..c50c544cb5 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -2402,9 +2402,9 @@ html-mode
(setq-local sgml-empty-tags
;; From HTML-4.01's loose.dtd, parsed with
- ;; `sgml-parse-dtd', plus manual addition of "wbr".
+ ;; `sgml-parse-dtd', plus manual additions of "source" and "wbr".
'("area" "base" "basefont" "br" "col" "frame" "hr" "img" "input"
- "isindex" "link" "meta" "param" "wbr"))
+ "isindex" "link" "meta" "source" "param" "wbr"))
(setq-local sgml-unclosed-tags
;; From HTML-4.01's loose.dtd, parsed with `sgml-parse-dtd'.
'("body" "colgroup" "dd" "dt" "head" "html" "li" "option"
--
2.29.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-30 6:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-29 21:23 bug#46181: 28.0.50; html-mode wrong indentation when using source element Mauro Aranda
2021-01-29 21:28 ` Mauro Aranda
2021-01-30 6:48 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).