{"action":"created","issue":{"url":"https://api.github.com/repos/sapegin/richtypo.js/issues/27","repository_url":"https://api.github.com/repos/sapegin/richtypo.js","labels_url":"https://api.github.com/repos/sapegin/richtypo.js/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/sapegin/richtypo.js/issues/27/comments","events_url":"https://api.github.com/repos/sapegin/richtypo.js/issues/27/events","html_url":"https://github.com/sapegin/richtypo.js/pull/27","id":374028763,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1ODIzNTM1","number":27,"title":"WIP - Next version of richtypo","user":{"login":"dbismut","id":5003380,"node_id":"MDQ6VXNlcjUwMDMzODA=","avatar_url":"https://avatars2.githubusercontent.com/u/5003380?v=4","gravatar_id":"","url":"https://api.github.com/users/dbismut","html_url":"https://github.com/dbismut","followers_url":"https://api.github.com/users/dbismut/followers","following_url":"https://api.github.com/users/dbismut/following{/other_user}","gists_url":"https://api.github.com/users/dbismut/gists{/gist_id}","starred_url":"https://api.github.com/users/dbismut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbismut/subscriptions","organizations_url":"https://api.github.com/users/dbismut/orgs","repos_url":"https://api.github.com/users/dbismut/repos","events_url":"https://api.github.com/users/dbismut/events{/privacy}","received_events_url":"https://api.github.com/users/dbismut/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":47,"created_at":"2018-10-25T16:22:03Z","updated_at":"2018-11-05T07:57:06Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/sapegin/richtypo.js/pulls/27","html_url":"https://github.com/sapegin/richtypo.js/pull/27","diff_url":"https://github.com/sapegin/richtypo.js/pull/27.diff","patch_url":"https://github.com/sapegin/richtypo.js/pull/27.patch"},"body":"Hey @sapegin, so here are the latest developments!\r\n\r\n### Linting\r\nI've enforced `eslint-config-airbnb-base` style on all files, with `prettier` compatibility. These are pretty strict rules but they make the code cleaner imo. All linting configuration is in the `.eslintrc` file. Not sure if I made the right move there so happy to make any change you would suggest.\r\n\r\n### Rules\r\nI think each language rules should be compiled in their own package. So I've exported a `compileRules` function from the `richtypo` package that compiles defs and rules (ie will replace all variables such as `${nbsp}` with their actual values).\r\n\r\n### Richtypo\r\nOk so here is how it works now.\r\n\r\n```js\r\nimport richtypo from 'richtypo';\r\nimport rules from 'richtypo-uk-rules'; \r\n\r\nconst rt = richtypo(rules);\r\nconst result = rt('quotes', `This is a \"texte \"with inner text\" in quotes\"`);\r\n\r\nconsole.log(\r\n  result.string(), // removes all html tags\r\n  result.html(), // transforms hairspace unicode into html entity &#x202F;\r\n  result.raw(), // provides the untouched result\r\n);\r\n\r\n// will run all rules\r\nrt.all('longer text');\r\n```\r\n\r\nSo I haven't implemented the next level of currying such as `dbQuotes=rt('quotes')` but this would be easily doable).\r\n\r\n### Example\r\nI've rebuilt it using the latest version of `fledermaus` and made it so that it shows the original text and highlights changes to the user. Here is a capture below ;)\r\n\r\n<img width=\"1052\" alt=\"image\" src=\"https://user-images.githubusercontent.com/5003380/47515233-9a3f7c00-d882-11e8-938f-07846bfcf1c5.png\">\r\n\r\nNotice that there is no special dash or quotes in the original text :)\r\n\r\nThat's it!"},"comment":{"url":"https://api.github.com/repos/sapegin/richtypo.js/issues/comments/435784047","html_url":"https://github.com/sapegin/richtypo.js/pull/27#issuecomment-435784047","issue_url":"https://api.github.com/repos/sapegin/richtypo.js/issues/27","id":435784047,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTc4NDA0Nw==","user":{"login":"dbismut","id":5003380,"node_id":"MDQ6VXNlcjUwMDMzODA=","avatar_url":"https://avatars2.githubusercontent.com/u/5003380?v=4","gravatar_id":"","url":"https://api.github.com/users/dbismut","html_url":"https://github.com/dbismut","followers_url":"https://api.github.com/users/dbismut/followers","following_url":"https://api.github.com/users/dbismut/following{/other_user}","gists_url":"https://api.github.com/users/dbismut/gists{/gist_id}","starred_url":"https://api.github.com/users/dbismut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbismut/subscriptions","organizations_url":"https://api.github.com/users/dbismut/orgs","repos_url":"https://api.github.com/users/dbismut/repos","events_url":"https://api.github.com/users/dbismut/events{/privacy}","received_events_url":"https://api.github.com/users/dbismut/received_events","type":"User","site_admin":false},"created_at":"2018-11-05T07:57:06Z","updated_at":"2018-11-05T07:57:06Z","author_association":"COLLABORATOR","body":"Nope I think I’m done!"}}
{"actor":{"display_login":"dbismut"}}