Topic on Extension talk:VisualEditor

Yaron Koren (talkcontribs)

Hi - a "subline" (maybe there's another term for it, but that's the one I know) is an indented line within a bulleted or numbered list - in wikitext it's defined by starting a line with "*:" or "#:". VisualEditor handles the round-tripping for these fine. The problem is creating a new subline within the VE interface. Hitting Shift+Enter when on one line of a list seems like it does that - it creates a new line within the list, that's indented - but the resulting wikitext has that new line as just additional text on the line above it. In other words, instead of:

# Item one
#: Comment about item one
# Item two

...the resulting wikitext is:

# Item one  Comment about item one
# Item two

Is this a bug? Or is there another way to create sublines?

Whatamidoing (WMF) (talkcontribs)

You are trying to combine ordered-list formatting with definition-list formatting, which is bad HTML. The visual editor does not fully support definition-list formatting yet, but this is the sort of thing that shouldn't be done (that way) anyway.

If you want a visual indentation, then you might consider trying w:en:Template:Pb. The wikitext would then be:

# Item one {{pb}} Comment about item one
# Item two

and the results would be what you seem to be looking for.

Yaron Koren (talkcontribs)

Whatamidoing - thanks for responding. I'm very surprised that you say that the first snippet of wikitext I provided is bad. Whatever HTML it corresponds to (I have no idea, actually), the wikitext itself displays fine and looks quite logical. Are you sure that it's not recommended? What's the point of notation like "#:", if not for cases like this?

Whatamidoing (WMF) (talkcontribs)
Yaron Koren (talkcontribs)

Sorry, I don't understand - what should I look at there?

Lens0021 (talkcontribs)

Whatamidoing - thanks for responding. I'm very surprised that you say that the first snippet of wikitext I provided is bad. Whatever HTML it corresponds to (I have no idea, actually), the wikitext itself displays fine and looks quite logical. Are you sure that it's not recommended? What's the point of notation like "#:", if not for cases like this?

In the #Indentation section said: "A colon (:) at the start of a line marks that line in the MediaWiki parser as the <dd>...</dd> part of an HTML description list (<dl>...</dl>). The visual effect in most Web browsers is to indent the line. This is used, for example, to indicate replies in a threaded discussion on talk pages. However, this markup alone is missing the required <dt> (term) element of a description list, to which the <dd> (description/definition) pertains. As can be seen by inspecting the code sent to the browser, this results in broken HTML (i.e. it fails validation). The result is that assistive technology, such as screen readers, will announce a description list that does not exist, which is confusing for any visitor unused to Wikipedia's broken markup. This is not ideal for accessibility, semantics, or reuse, but is currently commonly used, despite the problems it causes for users of screen readers."

Anyway why hitting Shift+Enter within a list seems like it make a line break, but actually just double spaces ?

Yaron Koren (talkcontribs)

@Lorentz21 - right, but this doesn't involve a colon at the start of the line - I'm talking about the notation "#:" (or "*:"). That "Accessibility" page says that "*:" is "acceptable practice" - I assume it's the same for "#:". So why not have VE generate that?

You're right, though, that the current approach of just putting in spaces is not ideal by any standard.

Whatamidoing (WMF) (talkcontribs)

Under some circumstances, a colon does not have to be the very first character for it to be interpreted as the second part of an HTML description list.

Yaron Koren (talkcontribs)

@Whatamidoing - I just don't understand. The Accessibility page you linked to says that "*:" is acceptable - is that incorrect? Or is there some difference between that and what I'm talking about?

Whatamidoing (WMF) (talkcontribs)

Editors at the English Wikipedia accept it. AIUI it does not produce valid HTML.

Yaron Koren (talkcontribs)

Oh, okay. Has been there any discussion about the lack of desirability of "#:" and "*:"? Is it documented anywhere?

In any case, I think just putting in a <br />, instead of spaces, would be fine also - as @Lorentz21 also said.

Reply to "Creating "sublines""