joseph / Monocle

A silky, tactile browser-based ebook JavaScript library.
http://monocle.inventivelabs.com.au
MIT License
743 stars 200 forks source link

Certain characters should be forbidden in components name #224

Open seblucas opened 10 years ago

seblucas commented 10 years ago

Hi,

I've made a PHP wrapper to read Epub with Monocle and in an Epub the components looks like that :

Author-BookTitle-split-00X

That cause this problem :

var matcher = new RegExp('^'+decodeURIComponent(cmptId)+"(#(.+)|$)");

SyntaxError: invalid range in character class http://localhost/monocle/resources/monocle/scripts/monocore.js Line 2952

The dash (-) is interpreted as a part of the regexp.

I know I can replace all dashes by other characters but I think you should know.

Thanks for Monocle :)