orbitbot / misbehave Goto Github PK
View Code? Open in Web Editor NEWAdd IDE-like text entry to HTML contenteditable tags
License: MIT License
Add IDE-like text entry to HTML contenteditable tags
License: MIT License
Pressing newline / enter when using it in Firefox (Chrome works fine) does not actually create a newline
When I paste the contents of code into a misbehave component the resulting code is displayed in single line instead of many lines the code was copied from.
Is there any way to show the line breaks of code that has has been pasted in?
De-indent removes all content in code block before a multiline selection, if that selection starts before the first character on a line
Enter and make selection as the following,
var moo = 3
>function() {
return 42
}<
... press shift + tab:
>function() {
return 42
}<
var moo = 3
>function() {
return 42
}<
misbehave
currently intentionally works in a simplified manner when considering the possible contents of a contenteditable
block, only concerning itself with the text contents of the targeted HTML tag and overwriting the content as text f.e. when performing undos and redos.
This approach is problematic if we would like to work with more complex content in the block, such as extra spans provided by syntax-highlighting libraries like Prism.js. Currently on-the-fly syntax highlighting is not possible since the extra elements added will confuse the simplistic selection and text extracting and setting functionality, causing destructive input in the wrong locations and selecting the wrong elements. A more refined approach as indicated in the following might allow for continuous syntax-highlighting:
[1-2] Indicates how to select text across multiple elements given a start and end, which should match prefix.length
and prefix.length + selected.length
internally used by misbehave
. The same functionality combined with a reverse approach should together with some edits to how misbehave
currently works would probably be enough to implement working continuous syntax highlighting.
Hello, is there a way to prevent default behaviour on key press? I'm trying to use your lib to build a javascript in-browser console. Currently i've stuck on problem with impossibility of not append a new line character on "run" code. (not insert \n if user pressed Enter)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.