Commit graph

52 commits

Author SHA1 Message Date
John McLear
a4bdcc3392
tests/editor/ul/li/ol/import/export: Introduce contentcollector.js tests & various OL/UL/LI related bugfixes
1. Introduce contentcollector.js backend tests
1. Fix issue with OL LI items not being properly numbered after import
1. Fix issue with nested OL LI items being improperly numbered on export
1. Fix issue with new lines not being introduced after lists in on import #3961
1. Sanitize HTML on the way in (import)
1. Fix ExportHTML CSS because it needs to support OL > LI > OL not OL > OL [The latter being the correct format]
1. Fix backend tests.
2020-06-05 20:54:16 +01:00
John McLear
2011c24f57
editor: Don't restrict plugins from being able to bring in newline content
#2412 broke this, it was discovered in https://github.com/JohnMcLear/ep_copy_paste_images/issues/20.

The limitation means that images can't be pasted within lists which IMHO is fine.  I could refine this down to OL only but I think images within lists would be fine not to include.
2020-05-29 16:53:08 +01:00
John McLear
f6907c5fad contentcollector: remove weird stuff LibreOffice adds to DOM before importing 2020-04-08 22:51:25 +02:00
John McLear
85217b55e0 contentcollector: pasting an OL in Chrome inserted an additional line break. Fixed.
This comments out some code that was probably a quirk from ie6 era.
See PR: https://github.com/ether/etherpad-lite/issues/2412

Fixes #2412.
2020-03-30 02:28:08 +02:00
muxator
840b4a0988 contentcollector: backed out changeset 3292429ab3
That commit (merged recently with PR #3622) was part of an effort to fix #3620,
but introduced a very bad bug that broke the cursor behaviour when pressing
space, making the program unusable.

This commit completes the revert of PR #3622 and fixes #3728.

--HG--
branch : revert-3622
2020-03-19 02:53:41 +01:00
Tom Briles
3292429ab3 trim text entries upon import. Fixes: #3620 2020-03-15 11:35:08 +00:00
muxator
dc7e49f89d Remove trailing whitespaces
Hoping to minimize future diffs. Not touching vendorized libraries.
2019-04-16 00:34:29 +02:00
Olivier Tétard
275a7d31e0 Avoid space removal when pasting text from word processor.
Since bf380eea50, some spaces were removed when pasting text from a word processor (at least using Libre Office). To avoid double space creations and space removal, we only remove line break which are tight to a space character.
2015-07-27 16:38:57 +02:00
Luiza Pagliari
58ab17bf9e Fix the way Content Collector gets the node class. Fixes #2640 2015-04-28 05:31:07 -07:00
John McLear
b6ff1807da Merge pull request #2482 from ether/chrome-list-handling
chrome list handling fix for #2412
2015-03-31 23:19:47 +01:00
Thomas Muehlichen
1c05933dc9 Feature #2567 Added workaround to enable contentcollector to write key-value attributes 2015-03-26 18:49:35 +01:00
John McLear
35da64be5c hrm bit of a hack, anyone any ideas on better way? 2015-01-28 19:09:47 +00:00
John McLear
0216a10a12 better variable name 2015-01-27 20:10:38 +00:00
John McLear
bdfce1cbef change to cc.. 2015-01-27 19:41:01 +00:00
John McLear
8fbd7d83b6 content collector should also register the blocks, no idea why this wasnt in before 2015-01-27 19:16:36 +00:00
John McLear
c4f1189ebd even cleaner 2015-01-26 02:39:43 +00:00
John McLear
18121a1507 much cleaner 2015-01-26 02:32:58 +00:00
John McLear
8156930208 clean support for image hook 2015-01-26 01:44:40 +00:00
John McLear
5dce72d419 chrome list handling fix for #2412 2015-01-23 01:47:12 +00:00
John McLear
3fd6e72657 try again 2015-01-21 15:06:29 +00:00
John McLear
990e14c904 working with a big hack 2015-01-21 14:25:24 +00:00
John McLear
eacf1118f8 blind attempt to try 2015-01-21 02:55:03 +00:00
John McLear
ab71bc7c20 hrm 2015-01-19 14:45:49 +00:00
John McLear
83fae22279 allow list text entry up to 16 items 2015-01-18 15:32:48 +00:00
webzwo0i
82efcdb430 fix for uls without class 2015-01-09 02:04:03 +01:00
John McLear
8eb723b906 patch for e1c683be3f 2014-12-31 14:16:10 +00:00
webzwo0i
e1c683be3f differentiate between indents and bullets in unordered lists 2014-12-29 16:12:07 +01:00
John McLear
cfa3f15f94 Merge pull request #2373 from webzwo0i/avoid-global-vairables
dont make local variables global
2014-12-16 00:41:41 +00:00
webzwo0i
5d15f655f0 dont make local variables global 2014-12-14 22:01:28 +01:00
John McLear
2c728b8e1b sanitizer change 2014-11-27 00:45:22 +00:00
John McLear
60d44cd3df use cheerio instead of jsdom 2014-11-25 17:26:09 +00:00
John McLear
bf380eea50 take line breaks and treat them appropriatly instead of creating a space for them.. 2014-11-01 18:07:34 +00:00
Luc Didry
3d8452b143 Replace tabs indentation with spaces indentation
Some files are obviously external libraries, I didn't touch them
2013-12-05 08:41:29 +01:00
Marcel Klehr
146c75e703 Remove console.log in content collector
fixes #1731
2013-04-17 16:37:45 +03:00
Chia-liang Kao
4827cdbd96 fix imported ol that were turned into ul 2012-11-02 21:39:40 +08:00
Chia-liang Kao
8199bf8377 Do not assume window object exists 2012-10-23 15:21:05 +08:00
John McLear
e9e3ea305b Merge pull request #992 from gedion/develop
Added hooks and made some ace functions available to editorInfo Object
2012-09-14 04:51:17 -07:00
Gedion
3364eb131e fixed comments 2012-09-11 17:02:53 -05:00
Gedion
9be69ef258 fixed plugins 2012-09-11 16:21:14 -05:00
Chad Weider
1541237654 Use packaged version of UNorm. 2012-09-09 18:18:59 -07:00
Gedion
c37c48cd12 added hooks and made some functions available to editor info object in ace 2012-09-08 13:45:33 -05:00
Gedion
6d1cba2259 added hooks to contentcollector.js 2012-09-08 12:11:04 -05:00
Gedion
a2c8d21240 added hooks to contentcollector.js 2012-09-08 12:03:13 -05:00
Daniel Perez Alvarez
699aa299f8 Normalize inserted text using UNorm
For some reason, the client was sending the server a Unicode-normalized
version of inserted strings. So if for example we inserted the string
'ä' (i.e. \x61\xCC\x88) into the document, what would be sent to the
server would be 'ä' (i.e. \xC3\xA4).

This wouldn't be a problem on its own. BUT JavaScript reports that the
length of the first string is 2, while the length of the second one is
1.

So the command that was being sent to the server was 'Z:1>2*0+1$ä', when
it should really be 'Z:1>1*0+1$ä'. When the `checkRep` method checks the
length of the inserted string, it finds an inconsistency, and
disconnects the client.

We now normalize the inserted string before the command is generated, so
the length is always correct.
2012-08-13 17:09:02 +01:00
Wikinaut
11e601fbcd fix #890 test if console is available before writing to console.log 2012-08-01 14:34:03 +02:00
odony
a2bf577393 Fix #769 - wonky bug with pasted lists
After 6507614e459dac868d3c76355ca013d13132bc79 the contentcollector does not properly "exit" lists back to the `none` listType anymore.
The repro steps on #769 seem to pass correctly after this change.
2012-07-25 13:45:53 +02:00
Matthias Bartelmeß
6507614e45 made domline and content collector lineAttributes compatible 2012-04-07 02:12:42 +02:00
Matthias Bartelmeß
9efe838a32 removed unused variable 2012-04-07 01:57:10 +02:00
Chad Weider
ddda347f7a Merge branch 'require-paths' into plugin
Conflicts:
	node/server.js
	src/static/js/Changeset.js
	src/static/js/ace.js
	src/static/js/ace2_common.js
	src/static/js/ace2_inner.js
	src/static/js/broadcast.js
	src/static/js/changesettracker.js
	src/static/js/chat.js
	src/static/js/collab_client.js
	src/static/js/contentcollector.js
	src/static/js/domline.js
	src/static/js/linestylefilter.js
	src/static/js/pad.js
	src/static/js/pad_connectionstatus.js
	src/static/js/pad_docbar.js
	src/static/js/pad_editbar.js
	src/static/js/pad_editor.js
	src/static/js/pad_impexp.js
	src/static/js/pad_modals.js
	src/static/js/pad_savedrevs.js
	src/static/js/pad_userlist.js
	src/static/js/pad_utils.js
	src/static/js/timeslider.js
	src/static/js/undomodule.js
	src/static/pad.html
	src/static/timeslider.html
2012-03-10 15:08:09 -08:00
Egil Moeller
df531a7b2b Made ace actually use the new hooks system, and removed remnants of old system 2012-03-01 19:22:02 +01:00