Extras
MarkdownEditor
BitMarkdownEditor is a dependency-free markdown editor built on a plain textarea: a data-driven toolbar, keyboard shortcuts, smart list continuation, undo/redo, find & replace, table tools, image paste/drop/pick upload, autosaved drafts and EditForm validation, with a live GitHub-flavored preview rendered by the BitMarkdownViewer. Every command is a pure C# text transformation, and the toolbar, menus, panels and dialog follow the keyboard and ARIA patterns of their roles.
Forms & accessibility
Localized strings, EditForm validation and focus, and how the textarea, the toolbar and its panels are named, described and driven from the keyboard.
Localization
{0} templates so the
translation owns the word order.
Un éditeur localisé
Chaque libellé de l'éditeur vient du paramètre Strings :
survolez la barre d'outils, ouvrez la recherche ou lisez la barre d'état.
Forms & accessibility
aria-invalid and the error border. Label (or
LabelTemplate) names the textarea, Description (or DescriptionTemplate) describes
it, Required marks it, Name posts it with a plain form,
and OnSubmit makes Ctrl/Cmd+Enter submit. OnFocus, OnBlur, Focus,
Blur and AutoFocus handle the focus.
Accessibility
for attribute;
with no label the EditorAriaLabel of Strings ("Markdown editor") names it, and an
AriaLabel overrides both. Description and, while MaxLength is set, the status bar's
character counter describe it through aria-describedby. Required adds
aria-required, and Disabled adds disabled and aria-disabled.
role="toolbar" named by ToolbarAriaLabel, and one tab stop: the arrow
keys move between its enabled buttons (mirrored in RTL), and Home / End jump to the first and the last.
Every button has an aria-label, plus aria-keyshortcuts when its item has a
Shortcut. The format buttons (bold, italic, strikethrough, inline code, quote, the lists) report the
format at the caret through aria-pressed, and the find, full-screen and help buttons report
their panel the same way. A menu button (aria-haspopup="menu", aria-expanded)
opens on Enter, Space or Arrow Down with the focus on its first item; Arrow Up / Down, Home and End move
through it, and Escape closes it back onto its button. The heading levels are menuitemradio
items with aria-checked. A command run from the toolbar returns the focus to the textarea it
changed. ReadOnly disables, with aria-disabled, the buttons that change the text and
keeps the rest; Disabled disables them all.
role="dialog" that lists every shortcut; it
keeps Tab inside, and Escape or Ctrl/Cmd+/ closes it and returns the focus to the editor.
role="region" that opens with the
focus in its find box: its match count is a polite live region, Aa reports aria-pressed,
and Escape returns the focus to the editor.
role="group" named by PreviewAriaLabel, so the arrow
keys can scroll it, and F9, F11, Ctrl/Cmd+/ and Escape work from it too. It is not a live region, so its
updates while typing are not announced. Cycling the mode with F9 or the eye button is announced
("Preview mode") through a polite live region; a Mode set from code is not. When a mode change hides
the pane that has the focus, the focus moves to the visible one.
Keyboard tour
- Tab indents this item, Shift+Tab outdents it
- Escape, then Tab, moves the focus out
| Tab | walks |
|---|---|
| the | cells |
F9 cycles the panes, F11 goes full-screen and Ctrl+/ lists every shortcut.
Feedback
Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.