lojjic / bidi-js Goto Github PK
View Code? Open in Web Editor NEWA pure JavaScript implementation of the Unicode Bidirectional Algorithm
License: MIT License
A pure JavaScript implementation of the Unicode Bidirectional Algorithm
License: MIT License
When passing a mixed RTL, LTR and Emoji string to getReorderedString
, if the sentence is processed as rtl
, and the emoji is right after an LTR block it seems like it will be considered as a part of the LTR block, while the browser seems to considers it as a new RTL block (I'm not sure I'm 100% familiar with the implementation to use the right terms here):
if the original string is
RRR LLL N
(where N is the Emoji)
The browser will Render it (in a "direction: rtl"
block) as
N LLL RRR
but bidi.js will return
LLL N RRR
if the original string is
RRR LLL R N
both the browser and bidi.js will render it as
N R LLL RRR
a codepen demo:
https://codepen.io/tombigel/pen/gOJYQom
Is it expected?
Need a UMD-wrapped build file for use in non-ES modules environments.
Hi, need some help, please.
I'm dealing with combined LTR, RTL strings, with digits, symbols, arabic, latin, etc
I'm wondering is it possible to reorder a string value from the <input dir="rtr">
into a string that is actually displayed in the html element
I mean if I have in input
the value of the input is
How can I process the input string value to have a string with characters in an order as I see looking at the input
I tried bidi.getReorderedString method and it works cool for such cases:
in the case above the result of the method is exactly what i expect
but if I have arabic chars, then arabic characters are reversed after calling bidi.getReorderedString
Need to add some usage docs to the README.
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.