Last modified: 2014-07-07 18:37:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49742, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47742 - Support simple source code editing tools for the VisualEditor plugin for the SyntaxHighlight extension
Support simple source code editing tools for the VisualEditor plugin for the ...
Status: PATCH_TO_REVIEW
Product: MediaWiki extensions
Classification: Unclassified
SyntaxHighlight (GeSHi) (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Tongbo Sui
:
Depends on: 43126
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-26 17:41 UTC by Tongbo Sui
Modified: 2014-07-07 18:37 UTC (History)
14 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tongbo Sui 2013-04-26 17:41:59 UTC
Feature request:

A feature that supports insertion and simple editing of source code snippets in a general article. It may include a simple grammar checking mechanism which checks some fundamental grammatical errors such as having a { without closing it, having a () with a trailing period and nothing else, having solely a pair of brackets, etc.; an indentation correction tool which will perform indentation formatting on the codes; a beautify code tool which will reorganize code formatting, including indentation to make the code more reader-friendly in format.
Comment 1 Bartosz Dziewoński 2013-04-26 17:49:52 UTC

*** This bug has been marked as a duplicate of bug 43133 ***
Comment 2 Tongbo Sui 2013-04-26 17:54:22 UTC
I believe that request is too broad and this one is more specific. (In reply to comment #1)
> 
> *** This bug has been marked as a duplicate of bug 43133 ***
Comment 3 Bartosz Dziewoński 2013-04-26 18:14:22 UTC
If anything, it seems like this request would build on top of that one. It's currently just not possible to edit almost anything else than plaintext in VisualEditor (and it's not just an interface issue, but a backend one as well).

I'm reopening and marking as dependent on that one, then. Feel free to adjust this :)
Comment 4 Gabriel Wicke 2013-04-26 18:15:51 UTC
Making sure that arbitrary wikitext does not interact with other parts of the page is difficult. It is possible to enforce this for extension content, but generally not for arbitrary parts of a page.
Comment 5 Bartosz Dziewoński 2013-04-26 18:16:17 UTC
Ah, it seems I misunderstood, sorry. I though you are talking about the source code *of the article itself*, and it appears like you meant source code in different languages, such as what's included in a <syntaxhighlight> tag.

Sorry and please disregard my comments :)
Comment 6 Tongbo Sui 2013-04-26 18:29:31 UTC
I understand that the rich text is just a presentation and I can see in article source that the formats are defined using a set of markups. What I'm proposing is a plugin/feature which will take care of write the markup(plaintext) for the user when editing code snippets, just like what VisualEditor is intended to do (in my opinion). In addition source code needs special formatting that is different from natural written human language, so that's why I think the feature should include automatic indentation and such.
For editing just a part of the text, I'm thinking of an interface similar to a pop-up window, obscuring parts of the editing window. Just like when you insert an image the editor will have a new window pop up asking image url, alt text, target, etc. When you click insert the editor will convert your choice in that pop-up window to the plaintext with tags and other markups, which will be visually reflected in the main WYSIWYG editor.

(In reply to comment #5)
> Ah, it seems I misunderstood, sorry. I though you are talking about the
> source
> code *of the article itself*, and it appears like you meant source code in
> different languages, such as what's included in a <syntaxhighlight> tag.
> 
> Sorry and please disregard my comments :)

(In reply to comment #4)
> Making sure that arbitrary wikitext does not interact with other parts of the
> page is difficult. It is possible to enforce this for extension content, but
> generally not for arbitrary parts of a page.
Comment 7 James Forrester 2013-04-26 19:02:20 UTC
Given that this is about desired enhancements to a VisualEditor plugin for the SyntaxHighlight extension - bug 43126 - moving this there and marking as a dependency.
Comment 8 Tongbo Sui 2013-04-28 17:12:31 UTC
In a nutshell it would be a major front-end JS work and will leave backend as-is as much as possible. I'm pretty sure that it will only utilize tags currently available and won't affect backend at all.(In reply to comment #6)
Comment 9 Quim Gil 2013-05-02 22:39:08 UTC
Just a note to say that Tongbo Sui has submitted a GSoC proposal related to this report: https://www.mediawiki.org/wiki/User:Beanixster

Good luck!
Comment 10 Gerrit Notification Bot 2013-06-14 06:09:04 UTC
Related URL: https://gerrit.wikimedia.org/r/68615 (Gerrit Change I4adede9e05fd2236cee50ce03f597e8ff6b1914d)
Comment 11 Tongbo Sui 2013-07-30 05:38:55 UTC
Somebody with the power could you change the bug status to assigned, and it was assigned to me.
Also anyone who is interested please feel free to give code review at the following patch.

> Related URL: https://gerrit.wikimedia.org/r/68615 (Gerrit Change
> I4adede9e05fd2236cee50ce03f597e8ff6b1914d)
Comment 12 Gerrit Notification Bot 2013-07-30 05:43:00 UTC
Change 68615 had a related patch set uploaded by Jforrester:
Source code editing

https://gerrit.wikimedia.org/r/68615
Comment 13 Matthew Flaschen 2013-07-30 05:47:26 UTC
If you don't have permission to do it yourself, it's probably because you don't have the 'editbugs' right.  Hopefully, someone on this bug can give it you.  If not, ask on IRC.
Comment 14 Alex Monk 2013-07-30 15:06:42 UTC
CCing Andre who can give you editbugs.
Comment 15 Ed Sanders 2013-09-06 23:11:13 UTC
Tongbo: Re: your implmementation so far: Is the language spec something you've come up with yourself? Have you considered using an existing highlighter library, or at least basing your implementation on a existing language spec format (e.g. implementing GeSHi language specs in JS?)
Comment 16 Tongbo Sui 2013-09-06 23:23:44 UTC
The highlighter spec is ported from GeSHi's php into js. I didn't find spec for validator so I came up with myself.

(In reply to comment #15)
> Tongbo: Re: your implmementation so far: Is the language spec something
> you've
> come up with yourself? Have you considered using an existing highlighter
> library, or at least basing your implementation on a existing language spec
> format (e.g. implementing GeSHi language specs in JS?)
Comment 17 Matthew Flaschen 2013-09-09 22:19:13 UTC
(In reply to comment #15)
> Have you considered using an existing highlighter
> library, or at least basing your implementation on a existing language spec
> format (e.g. implementing GeSHi language specs in JS?)

GeSHi is GPLv2+, whereas VisualEditor is MIT.  So if any GeSHi code is reused, the authorship and licensing should be made clear.
Comment 18 Tongbo Sui 2013-09-09 22:27:26 UTC
For now no codes from GeSHi are directly reused. I just used them as reference for regex patterns. I said 'port' due to this fact.

(In reply to comment #17)
> (In reply to comment #15)
> > Have you considered using an existing highlighter
> > library, or at least basing your implementation on a existing language spec
> > format (e.g. implementing GeSHi language specs in JS?)
> 
> GeSHi is GPLv2+, whereas VisualEditor is MIT.  So if any GeSHi code is
> reused,
> the authorship and licensing should be made clear.
Comment 19 Quim Gil 2013-09-17 16:23:29 UTC
GSoC "soft pencils down" date was yesterday and all coding must stop on 23 September. Has this project been completed?
Comment 20 Tongbo Sui 2013-09-18 16:17:41 UTC
Yes.

(In reply to comment #19)
> GSoC "soft pencils down" date was yesterday and all coding must stop on 23
> September. Has this project been completed?
Comment 21 James Forrester 2013-10-02 18:51:38 UTC
Marking this also as fixed by Gerrit change #68615 - congratulations again!
Comment 22 James Forrester 2014-07-07 18:36:55 UTC
Re-opening as this is now unmerged.
Comment 23 Gerrit Notification Bot 2014-07-07 18:37:12 UTC
Change 114529 had a related patch set uploaded by Jforrester:
[WIP] Add VisualEditor support

https://gerrit.wikimedia.org/r/114529

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links