Jump to navigation Jump to search

About this board

Previous discussion was archived at Talk:VisualEditor/Archive 1 on 2015-09-01.

Some pages really cannot be edit in VisualEditor?

AlexeySlw (talkcontribs)

I use MediaWiki 1.31 and Parsoid 0.9.0.

I restored Russian Wikipedia from dump and have an error opening some pages in VisualEditor. For example, Россия/Russia, США/USA, Япония/Japan and other countries.

It may be my mistake, but these are the same pages that "protected" on Wikipedia (of course, I didn't check all the pages on Wikipedia, just those I interested in).

So, the question is: did I do something wrong or some pages really cannot be edit in VisualEditor?

Whatamidoing (WMF) (talkcontribs)

I can open w:ru:Россия in the visual editor. It's a large page (534,630 bytes, at the moment). Do you have problems with large pages?

Reply to "Some pages really cannot be edit in VisualEditor?" (talkcontribs)

should be "run without MediaWiki" instead of "run without without MediaWiki"

Majavah (talkcontribs)

fixed, thanks!

BoldLuis (talkcontribs)

In VisualEditor would exist the option: Insert > New Section, if you go to the end of the section, bellow which you want to put the new one. --

Another way is using a floating element and put it in the place where the new section is going to be. Or simply, click in a button "New section" and click in the place of the text where the new section is going to be (then would appear a floating bar with the text. "Is it in the correct place?. [Yes] / [No]" (in any case, writting a text in the place would disappear this floating bar / message).

BoldLuis (talk) 13:48, 1 May 2020 (UTC)

Whatamidoing (WMF) (talkcontribs)

Do you know how to change a line into a section heading? It's the dropdown menu towards the start of the toolbar, where it usually says "Paragraph" (for plain text).

Reply to "New section"

I should be able to name references

Summary by Whatamidoing (WMF)
Psiĥedelisto (talkcontribs)

I love the VE, I use it all the time. I've written extremely complicated, long articles with it, including en:2channel, en:Bureau of Immigration Bicutan Detention Center, en:West Coast Customs, and so on. I hate switching to source editing. This might seem bizarre given I work as a computer programmer, but it is what it is. I would like to be able to give my references more descriptive names than :1, :0, et cetera, as sometimes I unfortunately need to switch to source editing and stick a ref in a template or something. Is this planned?

Whatamidoing (WMF) (talkcontribs)
Reply to "I should be able to name references"

50 million edits in the visual editor on Wikipedia

Whatamidoing (WMF) (talkcontribs)

Whatamidoing (WMF) (talkcontribs)
BoldLuis (talkcontribs)
Reply to "50 million edits in the visual editor on Wikipedia"

Suggestion to put signature command on toolbar

Omda4wady (talkcontribs)

I suggest we change location of "signature command" from drop menu to be as a button on VE main toolbar

Whatamidoing (WMF) (talkcontribs)

Their theory in the past has been that wherever you find a tool in the visual editor, it's always in the same place.

You might be interested in the upcoming Talk pages project/replying tool. It auto-signs replies.

Reply to "Suggestion to put signature command on toolbar"

Conflicting keyboard shortcuts

Summary by Whatamidoing (WMF)
AhmadF.Cheema (talkcontribs)

The keyboard shortcut for editing a page through the VisualEditor is Alt+ Shift+V. The same key combination happens to be used for the Show changes button in WikiEditor. Therefore, while in source editing mode, pressing this shortcut causes the switch to Visual editing instead of showing changes in Source editing.

This couldn't have been by design, could it?

Whatamidoing (WMF) (talkcontribs)

I can't reproduce this on my Mac in Safari (the equivalent keyboard shortcut does nothing). Can you tell me your web browser and computer operating system? Also, does it matter whether the cursor is inside the editing box (rather than outside of it, e.g., in the search box)?

AhmadF.Cheema (talkcontribs)

Windows10 1903, Chrome v79.0.3945.130 (64-bit). Placement of cursor makes no difference, checked at all locations (header, footer, sidebar, preview area etc.).

On Firefox v72.0.1 - there, the keyboard shortcut toggles focus between the two Show changes and Visual editing buttons, probably the same as Safari.

On Microsoft Edge - Usually the Visual editing button is given preference, unless the cursor is specifically on the two: "Pages transcluded onto the current version..." and "This page is a member of ... hidden category..." lines, then the Show changes button is activated.

On Chromium-based Edge beta v80.0.361.33 - the same thing happens as in Chrome.

Reply to "Conflicting keyboard shortcuts"

Force Line Breaks in VE

Summary by Whatamidoing (WMF)
Konjurer (talkcontribs)

Is there a way to force line breaks in the VE? The editor does not place any space after a bulleted list and it does not look very good.

ESanders (WMF) (talkcontribs)

No, empty linebreaks will be removed by Parsoid no matter where they are in the document. Line spacing should be the responsibility of the skin's CSS, not the user.

Whatamidoing (WMF) (talkcontribs)

Parsoid is no longer removing line breaks.

Reply to "Force Line Breaks in VE"
BrandonXLF (talkcontribs)

Is there a way to get the current wikitext being shown in the editor using JavaScript?

Whatamidoing (WMF) (talkcontribs)

Why do you want to do that? I'm pretty sure that there's a much easier way to accomplish your goal.

BrandonXLF (talkcontribs)

For a user script that will run some regex replacements on the code in the editor.

ESanders (WMF) (talkcontribs)

I assume you are talking about 2017WTE, in which case the surface is in fact compatible with the textSelection API, so

$( '#wpTextbox1' ).textSelection( 'getContents' )

would work. You can use the same API to replace the contents with setContents.

Note this isn't the most efficient API as the whole document will be replaced. If you want to do more targeted replacements you can use the document's findText method. Here's an example script that fixes date formats:

var target =,
	surface = target.surface.model,
	// non-global regex for returning matches
	pattern = new RegExp( '([0-9]{1,2})/([0-9]{1,2})(?:/([0-9]{1,4}))?' );

target.initialEditSummary = 'Fix date formats.';

surface.documentModel.findText( new RegExp( pattern.source, 'g' ), { noOverlaps: true } ).map( function ( range ) {
	// Build all fragments before modifying
	return surface.getLinearFragment( range );
} ).forEach( function ( fragment ) {
	var matches = fragment.getText().match( pattern ),
		year = matches[ 3 ] ? +matches[ 3 ] : new Date().getFullYear();
	if ( year < 100 ) {
		year += 2000;
	// Sanity check that numbers are in range. Avoids matching things like 24/7.
	if ( +matches[ 1 ] > 12 || +matches[ 2 ] > 31 ) {
	fragment.insertContent( year + '-' + matches[ 1 ].padStart( 2, '0' ) + '-' + matches[ 2 ].padStart( 2, '0' ), true );
} );
Whatamidoing (WMF) (talkcontribs)

Is this complicated enough that you really need to use a script? VisualEditor (visual and wikitext modes) has a built-in find/replace module that handles regex.

BrandonXLF (talkcontribs)

I'm sure there's a better way to do it, but with the regex I'm using, I have to split the text into arrays and run several different regex rules on the text.

Reply to "Get wikitext using JavaScript"

Real-time collaboration progress?

MavropaliasG (talkcontribs)

This page says that real-time collaboration is a feature that is worked upon 'right now' for visual editor. My question is, has work started on real-time collaboration (e.g. google docs style) at all? If yes when will be able to see a first experimental version? In months or years?

At least for the standalone visual-editor, not the one in wikipedia

I have actually found this video which shows this feature implemented through togetherJS.


ESanders (WMF) (talkcontribs)

Hi, the page you found is from early 2017. Since then we have done a lot of the backend work to make real-time collaboration possible, and we even have some experimental code that MW users can install, see VisualEditor/Real-time collaboration. Unfortunately this feature is not in the team's priorities for the next year, so we can't make any commitments on when it might be ready, however if you watch the Real-time collaboration page, any updates will be posted there.

MavropaliasG (talkcontribs)

@ESanders (WMF) I did some reading on this task, and I saw you gave some presentations in 2017 and 2018, whose slides I read. You have some great questions inside, also outlined in this abstract. I am very curious if there are any good answers to those questions or not. Unfortunately the notetaker for the 2018 session did not provide any points from the discussion, Would it be possible, whenever you have time, to either put those questions on the task page, or to a page so that proposals to those problems are collaboratively solved? Thank you

ESanders (WMF) (talkcontribs)

Those panels will have been run by @Cscott though I doubt he has the old missing notes.

MavropaliasG (talkcontribs)

Thank you for replying. Is there a page that those questions are available for people to brainstorm on? I feel like having those up on a page (adjunct to the real-time collaboration page?) would allow people to find a solution, much more effectively than a 15-min hurried discussion in a conference. So please, if possible, add those questions somewhere prominent.

Moreover, another way to answering those questions, would be to just fix the bugs for the real time collaboration functionality (at least in the future) and allow third-party installations of mediawiki to use them and through trial and error find the best way (through their feedback) for this to work.

MavropaliasG (talkcontribs)

Thank you so much

Reply to "Real-time collaboration progress?"