help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: p tags and indenting in Html Mode


From: Tyler Smith
Subject: Re: p tags and indenting in Html Mode
Date: Mon, 31 Aug 2009 10:24:52 -0400
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Richard Riley wrote:
pjb@informatimago.com (Pascal J. Bourguignon) writes:
Tyler Smith <tyler.smith@eku.edu> writes:
Html mode recognizes that <p> tags don't need to be closed, so
successive tags get indented to the same level. But when an unclosed
<p> tag is followed by a heading (e.g., <h3>), the heading gets
indented as if it were within the previous <p>, as do all subsequent
tags that aren't <p> tags. In other words, the heading is indented
further than the <p> tags that were there before. How can I get html
mode to keep the indentation at the same level? I put a small example
below to clarify.

Close your tags!  So your html becomes more compatible with xhtml.

A lot of web designers don't go anyway near xhtml because it's a pain
and doesn't work properly anywhere other than in theory :-; A google for
"xhtml not working" tells you why.

Having said that closing tags is a better idea.

I don't really care one way or the other about xhtml. I tried closing my tags by turning on sgml-xml-mode. This makes html mode insert a closing </p> tag, which solves my original problem. But it also expects closing tags for other html tags that don't normally use them: link, base, img etc. So in sgml-xml-mode, indentation is screwed up following all of those tags. I can of course manually close my <p> tags, or use C-c /, but there should be a better way. Can I make html-mode close p tags without turning on sgml-xml-mode? I have tried poking around with the tag skeletons, but I find the documentation a little challenging.

As an off-topic aside, is xhtml still moving forward? I thought the W3C had recently decided to ditch it in favor of html 5? Anything I've read suggests that there's no compelling reason to use xhtml for webdesign. If that's the case, I'd rather get html-mode configured to support regular html. I'm not really invested in either option, I just want consistent indentation that doesn't require manually tweaking my tags.

Thanks again,

Tyler






reply via email to

[Prev in Thread] Current Thread [Next in Thread]