EnlighterJS / Plugin.WordPress

:package: Official WordPress Plugin of EnlighterJS
http://wordpress.org/plugins/enlighter/
GNU General Public License v2.0
115 stars 17 forks source link

Selective highlighting #282

Closed ajtruckle closed 4 years ago

ajtruckle commented 4 years ago

Hi!

I know we can highlight full lines of code.

But do you think it could be possible to highlight just sections of code on a line? For example, something like this:

Workbook-S-140-PublicTalk-WatchtowerStudy-ServiceTalk-Assignments-v1-Code3

AndiDittrich commented 4 years ago

Hi,

i didn't see any possibility to implement this within the editor plugins

AndiDittrich commented 4 years ago

btw: (imho) you're looking for the wrong solution...your scheme above looks like a custom "language" within XML....the bulletproof solution is to extend the XML language and add additional highlighting tokens to the attributes

ajtruckle commented 4 years ago

I understand your idea. In this situation I was not wanting a basic improvement to syntax highlighting style, I just wanted to make clear to the user the components in the XML they needed to pay attention to. Previously I was just some static images like the one I showed you. Now I am using EnlighterJS:

https://www.publictalksoftware.co.uk/sdm_downloads/workbook-s-140-with-weekend-meeting-and-duty-assignments-in-english/

Not to worry. Sounds like too much work.

ajtruckle commented 4 years ago

In basic terms I was think of ability to specify the start / end characters for the highlight, I dunno, maybe:

1[50-60], 2[60-70] would highlight chars 50 to 60 on line 1 etc. I know that it could only be used on a single line by line basis.

But I have no idea of complexity to implement.

AndiDittrich commented 4 years ago

the problem is not the implementation within EnlighterJS...the main issues are raised by the editing plugin support..

ajtruckle commented 4 years ago

I see, could nit not just be the existing "highlight numbers` edit box? So, instead of just putting in there:

1,2

I put:

1[50-60], 2[60-70]

Or, some other appropriate container 1{50-60}. It would still highlight the actual line number bit on the left (if the style sheet is configured to do so).

AndiDittrich commented 4 years ago

just putting the lines into an additional textbox is not an issue....other required changes are much larger

ajtruckle commented 4 years ago

Understood!