Page MenuHomePhabricator

VisualEditor: For article namespace, disable Heading-1s (<h1>), others?
Closed, ResolvedPublic

Description

From user suggestion:

Heading 1 is very rare on enwiki, and indeed on most other installations.
Where it is used (mostly on project discussion pages), it does not usually
need to be edited. VisualEditor should not offer it.

Version: unspecified
Severity: enhancement

Details

Reference
bz43334

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:01 AM
bzimport set Reference to bz43334.
  • Bug 44780 has been marked as a duplicate of this bug. ***

May want to cover content namespaces in general (but provide some way of getting them). Also to consider preventing H6s (and H5s?).

rogerchrisman wrote:

Agree--Visual Editor should not use <h1> HTML tags for headings at all because MediaWiki uses <h1> HTML for page name and headings are subordinate to page name. Heading-1 should create <h2> HTML tags, Heading-2 <h3> HTML tags, Heading-3 <h4> HTML tags, etc. Newcomers don't know this. Visual Editor should simply do this correctly without editors needing to know or think about it at all. Offering <h1> HTML in Visual Editor will cause confusion and misuse among the very people Visual Editor is designed to empower. They just wont it to work right.

rogerchrisman wrote:

Agree--Visual Editor should not use <h1> HTML tags for headings at all because MediaWiki uses <h1> HTML for page name and headings are subordinate to page name. Heading-1 should create <h2> HTML tags, Heading-2 <h3> HTML tags, Heading-3 <h4> HTML tags, etc. Newcomers don't know this. Visual Editor should simply do this correctly without editors needing to know or think about it at all. Offering <h1> HTML in Visual Editor will cause confusion and misuse among the very people Visual Editor is designed to empower. They just want it to work right.

(In reply to comment #4)

Agree--Visual Editor should not use <h1> HTML tags for headings at all
because
MediaWiki uses <h1> HTML for page name and headings are subordinate to page
name. Heading-1 should create <h2> HTML tags, Heading-2 <h3> HTML tags,
Heading-3 <h4> HTML tags, etc. Newcomers don't know this. Visual Editor
should
simply do this correctly without editors needing to know or think about it at
all. Offering <h1> HTML in Visual Editor will cause confusion and misuse
among
the very people Visual Editor is designed to empower. They just want it to
work
right.

Except "Heading 1" is actually create-able on any wiki page ("= Foo ="), it's just discouraged. This is a tension between what the software /lets/ users do and what they /should/ do. I'm not convince that hard and fast global rules are always appropriate.

rogerchrisman wrote:

(In reply to comment #5)

(In reply to comment #4)

Agree--Visual Editor should not use <h1> HTML tags for headings at all
because
MediaWiki uses <h1> HTML for page name and headings are subordinate to page
name. Heading-1 should create <h2> HTML tags, Heading-2 <h3> HTML tags,
Heading-3 <h4> HTML tags, etc. Newcomers don't know this. Visual Editor
should
simply do this correctly without editors needing to know or think about it at
all. Offering <h1> HTML in Visual Editor will cause confusion and misuse
among
the very people Visual Editor is designed to empower. They just want it to
work
right.

Except "Heading 1" is actually create-able on any wiki page ("= Foo ="), it's
just discouraged. This is a tension between what the software /lets/ users do
and what they /should/ do. I'm not convince that hard and fast global rules
are
always appropriate.

This is not about convincing anyone "that hard and fast global rules are
always appropriate." This is about getting it right for MediaWiki and MediaWiki users. Having "Heading-1" create wrong first level headings is wrong because orrect first level headings are <h2> in MediaWiki, subordinate to the page name <h1> that _is_ 'hard and fast' coded into the wiki page generator because that works well, always has, and is correct HTML. Users should not need to think about HTML at all. VisualEditor should just work right, not wrong. I know = Foo = gives <h1>Foo</h1>. That is an unfortunate wiki markup parser bug. If the VisualEditor team is too week to fix this bug by removing <h1> from the editor, they may implement "Header-0 _deprecated_" as <h1> (and link "_deprecated_" to a mediawiki.org page explaining why it is deprecated and why nevertheless included in VisualEditor). That is the obvious easy way out. However, VisualEditor has no need nor obligation to implement the deprecated and seldom used = Foo =. So remove it now and save everyone the mind drain of "Header-0 _deprecated_". VisualEditor is NOT an HTML editor. It is a MediaWiki page editor.

  • Bug 48955 has been marked as a duplicate of this bug. ***

Does this really have much to do with the VE to begin with ? It's already allowed. I agree that such is a bad thing but that's a separate story. I guess at most, we could make the H1 option 'non visisble' unless the current element already is exactly of that type.

What would be nice, was if the VE would have more 'guided' heading building. It could warn you about inconsistencies in header levels for instance.

It is unfortunate that wikitext currently allows h1 elements. It shouldn't. It should be the end aim for the visual editor to have feature parity with wikitext, but at the current point it makes it natural to select a heading 1 when you really never want to do that. I would prefer to see it not available in the visual editor at all, but as a compromise, I could live with renaming Header 1 to Pageheader, and move it all the way to the bottom of markup elements, and rename header 2 to header 1, etc. That way we don't lose an option in the visual editor that is available in wikitext, and at the same time reduce the chance of people thinking it is an option they may want to choose for a header, which it is not.

At the same time, we may want to think about abandoning the option to make h1 headers in wikitext too, but that makes for a different discussion which should take place in a different place than this bug.

ypnypn9 wrote:

(In reply to comment #9)

It is unfortunate that wikitext currently allows h1 elements. It shouldn't.
It should be the end aim for the visual editor to have feature parity with
wikitext, but at the current point it makes it natural to select a heading 1
when you really never want to do that. I would prefer to see it not available
in the visual editor at all, but as a compromise, I could live with renaming
Header 1 to Pageheader, and move it all the way to the bottom of markup
elements, and rename header 2 to header 1, etc. That way we don't lose an
option in the visual editor that is available in wikitext, and at the same
time reduce the chance of people thinking it is an option they may want to
choose for a header, which it is not.

Instead of messing around with the numbers and having [heading 3 = <h4>], why not rename them "Heading", "Subheading", and "Sub-subheading".

(In reply to comment #10)

Instead of messing around with the numbers and having [heading 3 = <h4>], why
not rename them "Heading", "Subheading", and "Sub-subheading".

So:

H1: Title
H2: Heading
H3: Sub-heading
H4: Sub-sub-heading
H5: Sub-sub-sub-heading
H6: Sub-sub-sub-sub-heading

It might get a bit ridiculous, but I like the idea.

Kill the H1s from the editor please. They should really be considered deprecated in the wiki syntax, and aren't something that people should be able to create by accident.

(In reply to comment #12)

Kill the H1s from the editor please. They should really be considered
deprecated in the wiki syntax, and aren't something that people should be
able to create by accident.

VE is meant to be able to edit all content that's valid. Lots of wikis (e.g. meta) use H1s quite liberally. Discouraging use is fine, but preventing use feels wrong. (Also, what the hell should VE do when it encounters an H1 in the wild, if they were 'disabled'?)

AzaToth's suggestion is to label as follows:

H1: Title
H2: Heading
H3: Sub-heading
H4: Sub-heading
H5: Sub-heading
H6: Sub-heading

The differentiation between H3 - H6 would be only styling. Not sure how I feel about this, but it's certainly "correct".

Lots of wikis (e.g.meta) use H1s quite liberally.

I didn't know that, and it seems bad practice. Could you point to some examples? Maybe there is a use case I'm completely overlooking.

H1: Title
H2: Heading
H3: Sub-heading
H4: Sub-heading
H5: Sub-heading
H6: Sub-heading

I'm not so happy about the name "Title", and it being at the top of that list. I would much rather see it buried somewhere at the bottom, maybe as the very last option, and something like "Duplicate page title", or at least something that makes it abundantly clear that it is not something that is meant to be used.

I believe that the current list of titles will quickly be a problem if VE is rolled out to unexperienced users on wikipedia: they will probably use Heading 1 because they don't know it shouldn't be used in 99.9...% of edits.
When I tried to add a section, I used Heading 1 by default and only changed back to Heading 2 when I saw that the new title was bigger than what I'm used to.

If you think <h1> titles should be kept in VE, it should be separated from the other titles (after other ones). Eventually, would it be possible to make that configurable on a per wiki basis if some wiki really use <h1> as a normal title ?

Related URL: https://gerrit.wikimedia.org/r/69801 (Gerrit Change I5a58b4dcebd6ceae0ffcd24f663429f25bdc3db9)

Related URL: https://gerrit.wikimedia.org/r/69801 (Gerrit Change I5a58b4dcebd6ceae0ffcd24f663429f25bdc3db9)

This is now merged and will go out later today.