Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TemplateScript] support VisualEditor #69

Open
Pathoschild opened this issue Aug 29, 2015 · 2 comments
Open

[TemplateScript] support VisualEditor #69

Pathoschild opened this issue Aug 29, 2015 · 2 comments

Comments

@Pathoschild
Copy link
Owner

Add support for editing VisualEditor content. TemplateScript already supports the #wpTextbox1 wikitext editor and CodeEditor (since 2.0).

@Pathoschild
Copy link
Owner Author

VisualEditor support is tricky:

This raises a few issues for TemplateScript:

  • TemplateScript assumes all content can be manipulated through a text representation. That isn't true for VisualEditor. For example, with some work it could edit the text but it couldn't manipulate links which are non-textual.
  • Scripts that deal with wikitext won't work as expected (for example, '''bold text''' won't match bold text).
  • Search & replace across format boundaries need to resolve the boundaries somehow. (For example, do we bold the replace if half the match is bold?)

@he7d3r
Copy link
Contributor

he7d3r commented Aug 29, 2015

If I remember correctly, there is a way to get the wikitext which corresponds to the current VisualEditor representation the user is seeing in a page (no idea what is the command for that though), and this could be used so that users can apply the usual search/replace to this representation before saving the page (but if I'm not mistaken, this would have to be saved through the usual ways instead of using VE - that is, it would only be useful if the replacements are done after the user finished using VE for changing the page).

It is likely the same principle which allows one to switch to wikitext while editing with VE, but not to switch back to VE once the user is using wikitext.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants