mobiledoc-kit


Break link insertion with space in Mobiledoc-kit


Right now "default" behavior, when the user converts some text into the link, is to recognize consecutively inputted text as the part of the 'a' tag.
Let's take demo app as example:
there is a text 'This is Mobiledoc-kit' on the page
I select 'Mobiledoc-kit' fragment of it and make it a link pointing
to the https://bustlelabs.github.io/mobiledoc-kit/demo/
Right after that I started to type and entered ' example app' (pay
attention to leading space).
And this text became a part of the link, so now link is not just
'Mobiledoc-kit', but also all the text till the end of the line:
'Mobiledoc-kit example app'
Question here is how to make it 'humble'/not greedy' - denote that link border is within selected text only?
#lessless Thanks for this question!
This "bug" has been fixed now in mobiledoc-kit as of v0.10.2.
The "left/right inclusivity rules" for mobiledoc-kit markups were updated in this PR: https://github.com/bustlelabs/mobiledoc-kit/pull/438.
Links ("A" markups) have very conservative inclusivity...the cursor is only considered to be part of the link if it is completely within the text of the link (as opposed to on the left or right side).
A neat thing about this change is that in the future we can open up inclusivity rules to users of mobiledoc-kit, also. For instance you could deliberately make some markups "greedy" if you wanted to (e.g., normally a char is only bold if the character to the immediate left of the cursor was bold when the char was typed, but you could change the left-inclusivity of the bold markup so that text that is typed on the left side of a chunk of bold text also becomes bold...)

Related Links

Break link insertion with space in Mobiledoc-kit

Categories

HOME
oracle12c
polymer
formal-languages
static
interface
obfuscation
bitbucket-api
entity-framework-core
carousel
bookmarks
data-visualization
jtextpane
opengl-3
discrete-mathematics
stellar.js
mapstruct
nodemcu
solrcloud
pagespeed
short-url
resourcebundle
strongname
ckfinder
froala
opentk
entity-relationship-model
uitapgesturerecognizer
kudu
paragraph
utorrent
left-join
turfjs
erb
code-snippets
sammy.js
modalviewcontroller
pdw-file-browser
roblox
latitude-longitude
xdocreport
release
spring-mvc-test
branching-and-merging
escpos
glm-math
plan-9
jboss-4.2.x
truezip
opengl-4
boo
offline.js
rsa-archer-grc
model-associations
avspeechsynthesizer
jclouds
cda
findfirst
halcon
libvlc
concurrentmodification
custom-errors
file-move
lazybones
rate-limiting
atoi
typemock
vacuum
skspritenode
linked-tables
actionfilterattribute
bcache
grouping-sets
apache-spark-1.3
browserify-shim
mobility
lambda-architecture
cuba
spring-remoting
menubar
script#
android-icons
superscrollorama
device-width
curb
extreme-programming
fragmenttransaction
saxparseexception
filemerge
android-holo-everywhere
uipagecontrol
cuteeditor
http-daemon
mtu
cac
binomial-heap
ajax-polling
pagemethods
technical-debt
java1.4
blind

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App