fregante / GhostText

👻 Use your text editor to write in your browser. Everything you type in the editor will be instantly updated in the browser (and vice versa).
https://GhostText.fregante.com
MIT License
3.25k stars 116 forks source link

CodeMirror 2 Support (Jenkins) #282

Closed rmartine-ias closed 1 year ago

rmartine-ias commented 1 year ago

Our Jenkins, way under the hood, uses CodeMirror v.2.38. This was the thing I wanted to use GhostText for (and I'm not the only one).

I slapped together a CodeMirror page from that repo and some Jenkins source. Open index.html in a browser and hit the GhostText button; it should fail to detect the CodeMirror editor.

Completely understand if supporting older things is out of scope.

Full Rendered CodeMirror Block from real Jenkins Script Console ```html
1
2
3
yeah!!
 
this is
some groovy code
yeah!!
```
fregante commented 1 year ago

Sorry for the delay. I would accept a minimal PR to add support for CodeMirror 2 — or I'm open for sponsorship, but otherwise I can't spend time on this.

Depending on its API, this could be straightforward. Refer to CodeMirror 5’s implementation (CM6 got crazy, don't look at that)

https://github.com/fregante/GhostText/blob/388255d54f544112ad6dea214c2d94fb02678962/source/advanced-editors-messenger.js#L80-L96

Closing for now, PR still welcome

rmartine-ias commented 1 year ago

Thank you for the update, and completely understand!