Since T52770, we have been able to delete existing horizontal rules, but we still can't insert them. There is no item in the Insert menu for it. If you type the wikitext (----), the code gets nowiki'd. It should be possible to insert a horizontal rule on a page.
Description
Details
Related Objects
- Mentioned In
- T201573: Generalize logic for inserting a block level element into an empty paragraph (it should replace that paragraph, not insert before it)
T201472: List insertion by typing '#<space>', '*<space>' is broken - Mentioned Here
- rGVED3c30cac86e7b: Merge "Clean up after sequence insertion"
T52770: Horizontal lines (----, <hr>) extremely hard to delete
Event Timeline
Change 448067 had a related patch set uploaded (by DLynch; owner: DLynch):
[VisualEditor/VisualEditor@master] Add Horizontal Rules to the insert menu
Change 448068 had a related patch set uploaded (by DLynch; owner: DLynch):
[VisualEditor/VisualEditor@master] Clean up after sequence insertion
Change 448074 had a related patch set uploaded (by DLynch; owner: DLynch):
[mediawiki/extensions/VisualEditor@master] Add horizontal rule sequence (----)
Are we happy to add this to an already crowded insert menu? Is there a common use case on namespaces that use VE?
CC @Deskana
According to https://en.wikipedia.org/wiki/MOS:----, horizontal rules should not be used in articles. I don't know if such a rule is codified in other wikis, but this is definitely a common convention on Wikipedias.
We might want to make it a "secret" feature in MW (e.g. only allow inserting via a ---- sequence), or disable it in some namespaces (similar to how we handle signatures).
The old toolbar has a discouraging "Horizontal line (use sparingly)" as tooltip, WikiEditor doesn't have it at all. But I think as a sequence-only command (without tool in the toolbar) it does make sense, though you might want to limit the sequence to take only effect at the start of a paragraph and not inside the text (as that's how it works in wikitext).
No, and figuring out another way of doing this sensibly isn't a priority given that it's rarely used in the main namespaces on our largest projects.
Current version of the patches only implements inserting horizontal rules by typing ----. I think that's an uncontroversial improvement, and it is easy to support in the future (comparable to the {| sequence to insert a table that we already have), so I'm going to merge them.
Change 448067 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Add Horizontal Rule insert command
Change 448068 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Clean up after sequence insertion
Change 449794 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (3c30cac86)
Change 449794 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (3c30cac86)
Change 448074 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Add horizontal rule sequence (----)
Typing ---- is adding horizontal rule now. But copy-pasting isn't. Would that be a separate implementation?
It's the same as how pasting * doesn't make it become a list item. Which maybe it should? Not sure.
Yes, "sequences" are only triggered if you actually type them (or at least the last character). I consider them in the same class a keyboard shortcuts, so for me that makes sense.
The ve.ui.Sequence constructor actually does have a checkOnPaste option, but as you said, this isn't normally used, only for magic links (see ve.ui.MWLinkAction.js).