Page MenuHomePhabricator

CharInsert: Split displayed text from inserted code
Open, NormalPublic

Description

As the title says, the displayed text for CharInsert should be splitted from the inserted code.
E.g.: "includeonly" inserts <includeonly></includeonly>

It would also be awesome if multirow text could be inserted like templates and tables.

See also

Details

Reference
bz23354

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 21 2014, 11:03 PM
bzimport added a project: CharInsert.
bzimport set Reference to bz23354.
bzimport added a subscriber: Unknown Object (MLST).
Subfader created this task.Apr 30 2010, 1:09 PM

proppy wrote:

add custom label on charinsert

Attached:

proppy wrote:

Feel free to review this patch for inclusion in CharInsert extensions, it allows to customized the link label by passing a "label" argument to charinsert tag, example:

<charinsert label="foo">bar</charinsert>

proppy wrote:

Please tell me if it needs additional work.

proppy wrote:

add custom label on charinsert test case

Here is a test case that validated submitted patch behaviour.

Attached:

Sorry, had not time back then and now remembered this. The patch works fine (without the test case). Cheers!

*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*

How can I add line breaks using your patch? E.g. to insert

Healine

Text.

Another Headline

sumanah wrote:

Johan, I'm sorry for the wait. I'm marking this bug with "need-review" to signal to developers that there's code here awaiting review. Thank you for your patch and test case.

sumanah wrote:

Johan, does your patch still apply?

I recommend that you get a developer access account https://www.mediawiki.org/wiki/Developer_access so that you can commit your patches directly into the source control system in the future -- in fact, you could update and submit this patch, and get it reviewed faster. I'm sorry for the delay.

Kghbln added a subscriber: Kghbln.Mar 30 2015, 7:42 AM

This was requested again [1] so I guess the patch never made it to the official repo.

[1] https://www.mediawiki.org/wiki/Thread:Extension_talk:CharInsert/attributes

@Kghbln Yeah that was me. I am almost begging for someone to make it an official repo. I don't understand PHP well enough to do any tweaking of this extension myself, so please would someone do this.

He7d3r updated the task description. (Show Details)Mar 12 2016, 2:04 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 12 2016, 2:04 AM
Subfader added a comment.EditedSep 17 2016, 3:41 PM

5 years later and it's still not possible to create a one word button for multi-line code. E.g.

<charinsert label="Infobox"><nowiki>{{Infobox&#10; |&#10;}}</nowiki></charinsert>
Subfader added a comment.EditedSep 17 2016, 5:00 PM

CharInsert.body.php

12a13,17
> 		
> 		
>         global $charInsertArgs;
>         $charInsertArgs = $params;
> 		
51c56,61
< 		if ( $eend == '' ) {
---
> 		
> 		global $charInsertArgs;
> 		
> 		if( isset($charInsertArgs["label"]) && $charInsertArgs["label"] != "" ) {
> 			$inline = $charInsertArgs["label"];
> 		} elseif ( $eend == '' ) {

@Subfader: To get this moving, you are very welcome to use developer access to submit the proposed code changes as a Git branch directly into Gerrit which makes it easier to review them quickly and provide feedback. If you don't want to set up Git/Gerrit, you can also use the Gerrit Patch Uploader. Thanks again!

Can someone submit this patch?

@AlexeiKopylov : You can, or anybody else. See my previous comment. :)

I never done this, so I wonder if someone more familiar with the process can do it. It's not my code, and I don't know how to test it. Or is it OK to submit patch without testing? Also there are two patches above, I don't know which one is better.

After submitting to Gerrit, you could add a separate comment explicitly saying that it's untested