Commit Graph

10 Commits (3cbd386cf4c51b07450c718e445d27f15d067f1e)

Author SHA1 Message Date
Thomas Lavend'Homme 2abb2af472
Impove regex for emphasis 2019-12-22 10:06:35 -05:00
Gonçalo Silva 05cdfe0599 Use CommonMark's regexp for autolink / autoemail
Ref: https://github.com/commonmark/commonmark.js/blob/master/lib/inlines.js#L62-L64

Also avoids special handling in stats counter.
2019-07-25 00:18:33 +01:00
Manuel Genovés 300c386631 Added handling of alternate form of urls 2019-07-25 00:18:33 +01:00
Gonçalo Silva bb279d0379 Move stats counting to a worker process
A worker thread works in practice, but the GIL takes a significant toll
as the code is computationally heavy. The result is a hogged UI,
specially when other threads are involved (eg. markup handler).

A worker process is faster, hogs the UI significantly less, at the cost
of slightly higher memory usage.
2019-07-25 00:16:26 +01:00
Gonçalo Silva 0d87299040 Fix paragraph counting
Markdown requires at least 2 newlines to form a paragraph.
2019-07-25 00:16:26 +01:00
Gonçalo Silva 3f4f8292ca Use markup regexp for character count
Deferring to Pandoc is not without its faults. It still requires
processing (eg. horizontal rules turning into 72 dashes). It is
significantly slower and resource hungry.

On the reverse, the markup regexps have improved over time and are able
to handle the task.
2019-07-25 00:16:26 +01:00
Gonçalo Silva 241ba567e4 Fix character count with horizontal rules
Pandoc's conversion to plain text converts horizontal rules to a
sequence of 72 dashes. This update ensures that subsequent dashes
are ignored when counting characters.
2019-05-01 19:04:50 +01:00
Gonçalo Silva dccc645430 Add paragraphs stat 2019-04-19 11:26:21 +01:00
Gonçalo Silva c19f57f64b Add statistics for sentences and read time, allow user to toggle default
Fixes #63
2019-04-19 11:23:16 +01:00
Gonçalo Silva 1a7443fd3c Switch to a more powerful and accurate stats counter
The new stats counter is able to count characters, words, sentences, and
reading time.

It does so more accurately than before, by leveraging Pandoc's plain
format, and a few simple regular expressions that besides accuracy, also
improve support for Asian languages. It's all done on a background
thread to avoid hogging the UI.
2019-04-19 11:23:16 +01:00