unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#57131: regarding closing tags for non void html tags in html-mode skeletons
@ 2022-08-11  3:53 Yilkal Argaw
  2022-08-12 15:20 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Yilkal Argaw @ 2022-08-11  3:53 UTC (permalink / raw)
  To: 57131

Hi guys

I've kindof raised this issue on the emacs-devel mailing list and I
was recommended to report it as a bug or feature request in this
mailing list so here it goes.

In emacs insertion of html tags using the provided skeletons in
html-mode and mhtml mode uses skeletons for insertion of tags using
commands like sgml-tag. These skeletons are defined inside
html-tags-alist. The problem with using them is that they would not
generate closing tags for many of the tags (like <li> <p> because it
is assumed that only xml needs closing tags and the closing pairs are
controlled by the variable sgml-xml-mode. There should be a variable
to control this behaviour because the convention used widely in modern
html is to close tags as long as they are not "void elements". This
behaviour is even assumed in the indentation behaviour that it causes
weird indentation when inserting the something like list items inside
unordered list.

This reference link mentioned  the mailing list discussion by
tomas@tuxteam.de regarding html void elements  in the html5
specification might be a good reference

[1] https://www.w3.org/TR/2011/WD-html-markup-20110113/syntax.html#syntax-elements

always with regards
Yilkal





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#57131: regarding closing tags for non void html tags in html-mode skeletons
  2022-08-11  3:53 bug#57131: regarding closing tags for non void html tags in html-mode skeletons Yilkal Argaw
@ 2022-08-12 15:20 ` Lars Ingebrigtsen
  2022-08-12 20:56   ` Yilkal Argaw
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2022-08-12 15:20 UTC (permalink / raw)
  To: Yilkal Argaw; +Cc: 57131

Yilkal Argaw <yilkalargawworkneh@gmail.com> writes:

> The problem with using them is that they would not
> generate closing tags for many of the tags (like <li> <p> because it
> is assumed that only xml needs closing tags and the closing pairs are
> controlled by the variable sgml-xml-mode. There should be a variable
> to control this behaviour

The variable that controls this is `sgml-xml-mode', so just set that to
a non-nil value if you prefer these functions to insert close tags.

> because the convention used widely in modern
> html is to close tags as long as they are not "void elements".

No, that's not the convention used in "modern html".  Quite the opposite.

>  This behaviour is even assumed in the indentation behaviour that it
> causes weird indentation when inserting the something like list items
> inside unordered list.

If something is doing that, then it's not parsing HTML properly.  HTML
isn't XHTML.

I don't see anything to fix here, so I'm closing this bug report.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#57131: regarding closing tags for non void html tags in html-mode skeletons
  2022-08-12 15:20 ` Lars Ingebrigtsen
@ 2022-08-12 20:56   ` Yilkal Argaw
  2022-08-12 20:59     ` Yilkal Argaw
  0 siblings, 1 reply; 4+ messages in thread
From: Yilkal Argaw @ 2022-08-12 20:56 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 57131

Hi

> No, that's not the convention used in "modern html".  Quite the opposite.

Sorry if I am wrong. I will list the reasons for what  I said. I am
not trying to
make this into a debate but I am listing them if they make my argument clearer.

1. The wording in the HTML5 standard optional tags section
           Reference Link:
https://www.w3.org/TR/2018/SPSD-html5-20180327/syntax.html#optional-tags
      The wording used in this specification is that the
aforementioned closing tags
      may be omitted. There is no enforcement or recommendation on
this behavior.
      So a user is able to choose on the behavior that one requires
and it would not
      make the code XML. So the editor should not limit this option for XML code
      only.

Note: I am not talking about treating html and xml the same. I am also
not referring
          to tags that are labeled as void-elements in the HTML5
standard  but require
          closing tags on XML. I don't want to close <image> tag for
example but I might
          prefer to have closing tags for <p> <li> <td> and so on. So
what I was referring
          to was  having a variable like html-close-optional-tags or
html-close-optional-tags-alist
          which will allow the user to specify this behavior  instead
of just saying go to use
          xml-mode if you need this behavior.

2. This is how other tools do it so I may not be only one who prefers
to close my
     list-items and paragraphs.
         - Web Mode in Emacs
         - Emmet on Emacs
         - VS code
         - Cuda text
         - Atom (RIP)
         - Bluefish Editor
         - Sublime Text 3
         - Vim (vim-closetag plugin)

     I have even looked into the html source of  w3.org and the close
their <li>, <p> and <td> tags.

With Regards
Yilkal A.

On Fri, Aug 12, 2022 at 6:20 PM Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
> Yilkal Argaw <yilkalargawworkneh@gmail.com> writes:
>
> > The problem with using them is that they would not
> > generate closing tags for many of the tags (like <li> <p> because it
> > is assumed that only xml needs closing tags and the closing pairs are
> > controlled by the variable sgml-xml-mode. There should be a variable
> > to control this behaviour
>
> The variable that controls this is `sgml-xml-mode', so just set that to
> a non-nil value if you prefer these functions to insert close tags.
>
> > because the convention used widely in modern
> > html is to close tags as long as they are not "void elements".
>
> No, that's not the convention used in "modern html".  Quite the opposite.
>
> >  This behaviour is even assumed in the indentation behaviour that it
> > causes weird indentation when inserting the something like list items
> > inside unordered list.
>
> If something is doing that, then it's not parsing HTML properly.  HTML
> isn't XHTML.
>
> I don't see anything to fix here, so I'm closing this bug report.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#57131: regarding closing tags for non void html tags in html-mode skeletons
  2022-08-12 20:56   ` Yilkal Argaw
@ 2022-08-12 20:59     ` Yilkal Argaw
  0 siblings, 0 replies; 4+ messages in thread
From: Yilkal Argaw @ 2022-08-12 20:59 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 57131

Hi

> No, that's not the convention used in "modern html".  Quite the opposite.

Sorry if I am wrong. I will list the reasons for what  I said. I am
not trying to
make this into a debate but I am listing them if they make my argument clearer.

1. The wording in the HTML5 standard optional tags section
           Reference Link:
https://www.w3.org/TR/2018/SPSD-html5-20180327/syntax.html#optional-tags
      The wording used in this specification is that the
aforementioned closing tags may be omitted. There is no enforcement or
recommendation on this behavior.
      So a user is able to choose on the behavior that one requires
and it would not make the code XML. So the editor should not limit
this option for XML code only.

Note: I am not talking about treating html and xml the same. I am also
not referring to tags that are labeled as void-elements in the HTML5
standard  but require
          closing tags on XML. I don't want to close <image> tag for
example but I might prefer to have closing tags for <p> <li> <td> and
so on. So what I was referring to was  having a variable like
html-close-optional-tags or html-close-optional-tags-alist which will
allow the user to specify this behavior  instead of just saying go to
use xml-mode if you need this behavior.

2. This is how other tools do it so I may not be the only one who
prefers to close my list-items and paragraphs.
         - Web Mode in Emacs
         - Emmet on Emacs
         - VS code
         - Cuda text
         - Atom (RIP)
         - Bluefish Editor
         - Sublime Text 3
         - Vim (vim-closetag plugin)

     I have even looked into the html source of  w3.org and the close
their <li>, <p> and <td> tags.

With Regards
Yilkal A.

On Fri, Aug 12, 2022 at 11:56 PM Yilkal Argaw
<yilkalargawworkneh@gmail.com> wrote:
>
> Hi
>
> > No, that's not the convention used in "modern html".  Quite the opposite.
>
> Sorry if I am wrong. I will list the reasons for what  I said. I am
> not trying to
> make this into a debate but I am listing them if they make my argument clearer.
>
> 1. The wording in the HTML5 standard optional tags section
>            Reference Link:
> https://www.w3.org/TR/2018/SPSD-html5-20180327/syntax.html#optional-tags
>       The wording used in this specification is that the
> aforementioned closing tags
>       may be omitted. There is no enforcement or recommendation on
> this behavior.
>       So a user is able to choose on the behavior that one requires
> and it would not
>       make the code XML. So the editor should not limit this option for XML code
>       only.
>
> Note: I am not talking about treating html and xml the same. I am also
> not referring
>           to tags that are labeled as void-elements in the HTML5
> standard  but require
>           closing tags on XML. I don't want to close <image> tag for
> example but I might
>           prefer to have closing tags for <p> <li> <td> and so on. So
> what I was referring
>           to was  having a variable like html-close-optional-tags or
> html-close-optional-tags-alist
>           which will allow the user to specify this behavior  instead
> of just saying go to use
>           xml-mode if you need this behavior.
>
> 2. This is how other tools do it so I may not be only one who prefers
> to close my
>      list-items and paragraphs.
>          - Web Mode in Emacs
>          - Emmet on Emacs
>          - VS code
>          - Cuda text
>          - Atom (RIP)
>          - Bluefish Editor
>          - Sublime Text 3
>          - Vim (vim-closetag plugin)
>
>      I have even looked into the html source of  w3.org and the close
> their <li>, <p> and <td> tags.
>
> With Regards
> Yilkal A.
>
> On Fri, Aug 12, 2022 at 6:20 PM Lars Ingebrigtsen <larsi@gnus.org> wrote:
> >
> > Yilkal Argaw <yilkalargawworkneh@gmail.com> writes:
> >
> > > The problem with using them is that they would not
> > > generate closing tags for many of the tags (like <li> <p> because it
> > > is assumed that only xml needs closing tags and the closing pairs are
> > > controlled by the variable sgml-xml-mode. There should be a variable
> > > to control this behaviour
> >
> > The variable that controls this is `sgml-xml-mode', so just set that to
> > a non-nil value if you prefer these functions to insert close tags.
> >
> > > because the convention used widely in modern
> > > html is to close tags as long as they are not "void elements".
> >
> > No, that's not the convention used in "modern html".  Quite the opposite.
> >
> > >  This behaviour is even assumed in the indentation behaviour that it
> > > causes weird indentation when inserting the something like list items
> > > inside unordered list.
> >
> > If something is doing that, then it's not parsing HTML properly.  HTML
> > isn't XHTML.
> >
> > I don't see anything to fix here, so I'm closing this bug report.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-12 20:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11  3:53 bug#57131: regarding closing tags for non void html tags in html-mode skeletons Yilkal Argaw
2022-08-12 15:20 ` Lars Ingebrigtsen
2022-08-12 20:56   ` Yilkal Argaw
2022-08-12 20:59     ` Yilkal Argaw

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).