Comments (11)
Yes, this is a known issue we're going to have to tackle. In an effort to get a minimum viable implementation, we mapped the regular expressions in Ruby to simplistic ones in JavaScript. The regexp engine in JavaScript is quite primitive...even more so than the Ruby 1.8.7 engine the Asciidoctor regexps adhere to.
You can see the mapping from Ruby regexp to JavaScript regexp here:
https://github.com/asciidoctor/asciidoctor/blob/master/lib/asciidoctor.rb#L344
...there are some other places as well, but these are the majority of them.
The following article describes what we're going to need to do to get proper support for non-English languages.
http://mathiasbynens.be/notes/javascript-unicode
from asciidoctor.js.
It's greate plan!
But as a interim solution I propose change from "%H:%M:%S %Z" to "%H:%M:%S" in asciidoctor.js:2740
It's works and no any problem with Win7 Rus.
from asciidoctor.js.
Yep, we can put that in. However, it needs to go upstream into Asciidoctor
core since Asciidoctor.js is now 100% generated.
from asciidoctor.js.
May be better to change opal.js instead?
To return empty zone name.
from asciidoctor.js.
Could you paste a datetime string as it appears in win7 russian so I have an example to work with?
from asciidoctor.js.
I took a slightly different approach, but essentially the same implementation. I drop the timezone if it fails to resolve using a try/catch block.
from asciidoctor.js.
I'm still interested in the test date so I can sort out how to make a test for this case. I'm actually curious whether Ruby has a problem with this as well...but I haven't been able to figure out how to get Ruby to emit a timezone in Russian.
from asciidoctor.js.
try/catch is good idea.
Thu Mar 06 2014 12:52:51 GMT+0400 (Московское время (зима))
from asciidoctor.js.
For the record, here's an example:
Чт июл 7 08:06:41 МСК 2016
In order to reproduce, the JavaScript implementation has to produce this result when calling new Date().toString()
since the conversion happens in the internals of the Time class.
from asciidoctor.js.
Opal should probably use toLocaleDateString()
(and/or toLocaleTimeString()
) instead of toString()
so that it gets a consistent result to parse. After all, this is all internal state.
from asciidoctor.js.
Actually, that turns out to be not all that reliable. Whatever the solution, I think Opal should not be assuming that toString() is going to be in the en-US locale.
from asciidoctor.js.
Related Issues (20)
- How to get a search bar in the html output? HOT 1
- Update dependency for package pug to fix a vulnaribilty issue HOT 4
- Don't work in simple browser HOT 1
- Reusing extensions registry doesn't work in v3.0.2 HOT 4
- Migration guide similar to Asciidoctorj
- Cannot import TypeScript types under vite because "exports" does not include "types" HOT 1
- Missing borders of table cells preceding cell that spans multiple rows HOT 3
- Help with Reading Content of Included Files in Asciidoctor Include Processor Extension HOT 1
- Bug: Inline macro is splitting raw input in two paragraphs HOT 6
- Setting context of Abstract node no longer working? HOT 3
- "Module not found" error when using v3.0.3 in a Next.js app HOT 1
- Feature request: add a flag to disable converter template helpers loading to prevent arbitrary code execution HOT 9
- Issue with NPM latest tag HOT 1
- asciidoctor.loadFile and convert has no css HOT 2
- Support async/promise in extension API/registration HOT 1
- Parsing an inline link causes processor to crash for certain matches HOT 11
- Using asciidoctor.js in browser HOT 3
- `AbstractNode.hasAttribute()` doesn't take into account positional attributes HOT 1
- Unexpected behavior of include directive in 2.2.7 when parsing malformed title HOT 8
- Exact error message on @asciidoctor/core version 3.0.4 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asciidoctor.js.