Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ep_readability

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ep_readability - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

2

package.json
{
"name": "ep_readability",
"version": "0.0.10",
"version": "0.0.11",
"description": "Calculates the Flesch readability index in Etherpad, client based.",

@@ -5,0 +5,0 @@ "author": {

@@ -1,2 +0,2 @@

# Click to calculate the Flesch readability factor
# Click button to calculate the Flesch readability factor
There'll be a button. Push it.

@@ -7,8 +7,17 @@

Numeric values detail the readability:
* Negative numbers or near "0" indicate texts which are very difficult to read.
* Numbers near "100" indicate very easy texts.
a) Negative numbers or near "0" indicate texts which are very difficult to read.
Calculating is triggered by entering !, ?, RETURN or BACKSPACE. Or by pushing the button.
b) Numbers near "100" indicate very easy texts.
# Readability
Calculating is triggered by entering !, ?, RETURN or BACKSPACE. Or by pushing the button.
* -1000: Dissertation
* 10: Officialese
* 20: AmbitiousNewspaper
* 35: AverageNewspaper
* 50: YellowPress
* 60: SalesLetter
* 80: Slogan
* 90: Comic

@@ -19,3 +28,3 @@ # Install

Alternatively, browse to `http://yourEtherpadliteInstan.ce/admin/plugins`, search for `ep_readability` and click install.
Alternatively, browse to `http://yourEtherpadliteInstan.ce/admin/plugins`, search for `readability` and click install.

@@ -32,2 +41,2 @@ After restarting the server, the plugin takes effect.

https://github.com/DaveChild/Text-Statistics
`https://github.com/DaveChild/Text-Statistics`

@@ -11,9 +11,10 @@ // ----------------------------------------------------------------------------

exports.cleanText = function(text) {
//console.log(text);
// 1. Remove HTML entities @TODO add more entities
// 2. Remove Etherpad spans, headings (style plugin) and formatting
// 3. Get an Etherpad paragraph, add dot if no terminator or comma is at the end
text = text.replace(/ /gm,' ');
// @TODO replace the divs by a more simple paragraph placeholder delimiter
text = text.replace(/( )+/gm,' ');
text = text.replace(/<(?!div|\/div)[^>]*>/gm,'').replace(/<\/(?!div)>/gm,'');
text = text.replace(/<div[^>]*>([^<]+[^:,!?.-])<\/div>/gm, "$1.");
text = text.replace(/<div[^>]*>([^<]+[^:, !?.-])\s*<\/div>/gm, "$1.");

@@ -20,0 +21,0 @@ // This is not Etherpad specific:

@@ -48,2 +48,7 @@ var readab = require('../static/js/readability_button.js');

test.equal(result, readab.cleanText(text));
text = '<div id="magicdomid2" class=""><span class="author-a-z65zjckdup0xdseeity">Bedingungsloses Grundeinkommen und Mindestlohn&nbsp;</span></div><div id="magicdomid3" class=""><span class="author-a-z65zjckdup0xdseeity">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div><div id="magicdomid4" class=""><span class="author-a-z65zjckdup0xdseeity">Wir Piraten setzen uns für die Einführung eines bedingungslosen Grundeinkommens ein, das die Ziele des „Rechts auf sichere Existenz und gesellschaftlicher Teilhabe“ aus unserem Parteiprogramm erfüllt. Es soll:&nbsp;</span></div>';
result = 'Bedingungsloses Grundeinkommen und Mindestlohn. Wir Piraten setzen uns für die Einführung eines bedingungslosen Grundeinkommens ein das die Ziele des Rechts auf sichere Existenz und gesellschaftlicher Teilhabe aus unserem Parteiprogramm erfüllt. Es soll';
test.equal(result, readab.cleanText(text));
test.done();

@@ -50,0 +55,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc