1293 Commits

Author SHA1 Message Date
9c6618fdea Bump js-yaml (#996)
Bumps  and [js-yaml](https://github.com/nodeca/js-yaml). These dependencies needed to be updated together.

Updates `js-yaml` from 3.14.1 to 3.14.2
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.14.1...3.14.2)

Updates `js-yaml` from 4.1.0 to 4.1.1
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.14.1...3.14.2)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 3.14.2
  dependency-type: indirect
- dependency-name: js-yaml
  dependency-version: 4.1.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-22 00:29:45 +00:00
807dcf364b update dependencies (#977)
Also migrate config to new eslint format
2025-09-25 00:06:09 -07:00
6b154af961 Add Emoji Toolbox Plugin (#956)
* add new emoj plugin for unicode emojis toolbar

* added optional EmojiMart picker
2024-03-31 21:45:23 +01:00
Sam
122b4ea7fd Update dependencies (#946)
Updates all dependencies and opts into the new headless mode.
2024-01-15 15:48:59 +00:00
Sam
0540c9323a Fix checkWhitespace() error when no previous node (#935)
Fixes error with checkWhitespace() when an emoticon is matched to be
removed but there is no previous node.

Fixes #933
2023-08-25 18:05:26 +01:00
0ee103397c Release v3.2.0 v3.2.0 2023-03-05 17:19:55 +00:00
Sam
c368667ad5 Fix first/last pasted BBCode blocks being removed (#927)
When pasting in BBCode format, the first and last blocks were sometimes
being removed, such as:

[center]test[/center][center]test[/center][center]test[/center]

This also caused extra newlines to sometimes be added when pasting.
2023-03-01 15:01:21 +00:00
8172419be5 Allows inserting custom tags and attributes (#925)
Fixes #901

---------

Co-authored-by: Sam <sam@samclarke.com>
2023-02-20 16:46:39 +00:00
Sam
91c3c61083 Add missing strings to translation template and German translation (#920)
* Adds missing strings to translation template.
* Adds missing indent strings to German translation.

German translations by @wintstar.
2023-02-13 16:25:52 +00:00
Sam
7e8d20642a Update tests (#921)
* Removes `rimraf` dependency and updates dependencies to latest versions
* Fix auto focus issue with manual test caused by Less.js, fixes `autofocus` is unreliable in Firefox with manual test #912.
* Waits for Less.js to load before running tests (prevent any issues like `autofocus` is unreliable in Firefox with manual test #912)
* Fixes autoYoutube tests in FF due to changed parameter ordering
* Updates the `nodesEqual()` and `nodesNotEqual()` assertions to give better diffs.
2023-02-11 16:31:53 +00:00
Sam
8ee42c6b9a Fix merge() merging <br> tags (#922) 2023-02-07 00:15:59 +00:00
Sam
e4c47d0635 Fix code tags including styles from block elements (#916)
Improves the special case handling for code tags so they only include text content.

This stops code tags including styles from block elements and makes BBCode paste not handle styles in code tags

Also tidies code a little:

* vChildren will either be an array or undefined so no need to check type.
* Adding text node check to if statement removes need for early return nodeType check.

Fixes #915
2023-02-01 15:53:15 +00:00
Sam
d249647c20 Update actions (#914)
* Update labeller to latest version

* Update checkout in CodeQL action to v3
2023-01-26 15:45:10 -07:00
Sam
fd057f89f8 Fix undo plugin error when selectedRange() is null (#911)
Fixes #910
2023-01-25 17:43:23 +00:00
69c03a5e49 Bump json5 from 2.2.0 to 2.2.3 (#909)
Bumps [json5](https://github.com/json5/json5) from 2.2.0 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.0...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-08 02:27:05 +00:00
Sam
25c2e83671 Update node action and remove cache action (#905)
Updates the actions to the latest versions, updates node and removes the
cache action as the setup-node action now has built in cache support.
2022-11-24 16:04:29 +00:00
336169cf8a Bump loader-utils from 3.2.0 to 3.2.1 (#906)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v3.2.0...v3.2.1)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-24 15:39:39 +00:00
Sam
84747a38b5 Update all dependencies to latest versions (#903) 2022-11-24 15:38:56 +00:00
Sam
3002379123 Reduce _normaliseColour regular expression range. (#902)
It should only match 0-9 A-F not 0-F which includes extra characters.
2022-11-24 15:31:02 +00:00
Sam
2a91be8a3b Add SECURITY.md 2022-11-09 00:47:47 +00:00
Sam
c3943b1250 Update CodeQL action to latest version (#904) 2022-11-08 17:51:15 +00:00
Sam
6d7c57c274 Move test libraries into devDependencies (#899)
* Update dependencies

* Move test libs into devDependencies.

This moves the the dev dependencies into a more appropriate place and
should make keeping the updated easier.

The sinon-qunit library was completely removed as not needed.
2022-11-08 01:33:07 +00:00
0963a9dcb4 Update Dutch translation and fixes (#897)
Updated the Dutch translation and fixes a few translations.
2022-08-21 16:49:36 +01:00
a7fa22a12d Finnish translation (#882)
Add Finnish translation.
2022-03-10 21:04:44 +00:00
82d3279d2d Add some missing phrases in ru.js (#879)
* missing some phrases in ru.js
2022-02-09 06:07:40 +00:00
Sam
8c50e0b70a Update all dependencies. (#870)
Migrates webpackDevServer to v4.
2021-12-22 15:31:35 +00:00
59ca35329f Release version 3.1.1 v3.1.1 2021-12-22 10:58:43 +00:00
634bb93dd3 Fix bug with code tags matching block styles.
Make code tags skip block styles. Fixes #869
2021-12-22 10:53:19 +00:00
97fb4be6bc Update readme version number 2021-12-19 20:52:21 +00:00
34d3f6a4ef Release v3.1.0 v3.1.0 2021-12-19 20:39:10 +00:00
Sam
c7fb2240ef Add wildcard BBCode tag matching (#855)
* Add wildcard BBCode tag matching.

Adds ability to use wildcards to match tags and combines moves styles to
the style attribute.

This also renames the attrMatch property to strictMatching.

Fixes #589

* Improve JSDoc for strictMatch

* Update src/formats/bbcode.js

Co-authored-by: John Rayes <live627@gmail.com>
2021-11-22 17:37:39 +00:00
Sam
a3b9bc9f74 Fix alignment status issue in Firefox. (#859)
Firefox sometimes returns the -moz-right/-moz-left values for text-align
so this adds support for them.
2021-11-22 17:31:00 +00:00
31f2dfa347 Update editor to enale bfcache outside of a form 2021-10-14 18:00:21 +01:00
Sam
9212b07eab Update auto YouTube to strip unnecessary styles. (#854)
Fixes #660
2021-10-14 14:06:26 +01:00
07775d306f Alternative lists plugin implementation (#691)
* Alternative lists plugin implementation

* Unify handler functionality
2021-10-13 18:22:16 +01:00
Sam
4b8a0ff8d6 Update focus() to default to end if no selection (#851)
Updates the focus() method to default to placing the cursor at the end
if there is no current selection.
2021-10-13 18:14:16 +01:00
Sam
2f5ebaf0c7 Update textarea value on pagehide so back button and suspend don't loose value (#857)
* Fix going back in the browser causes content to be lost

If you use the back button in your browser then go forward, all the content is lost.  This is because the information is not sent back to the original prior to unloading the page.  This change simply attaches a event to the unload for window and triggers the base update to occur.  The browser handles the rest if it supports remembering what was entered into the textarea.

Signed-off-by: jdarwood007 <unmonitored+github@sleepycode.com>

* Use page events instead of unload for back fix.

Using the unload event can cause the browser not to use the bfcache:
https://web.dev/bfcache/
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/1.5/Using_Firefox_1.5_caching

Co-authored-by: jdarwood007 <unmonitored+github@sleepycode.com>
2021-10-13 18:08:08 +01:00
Sam
be9ebc2cf2 Convert div tags inside tags in XHTML format. (#852)
Converts all <div> tags that are in a <code> tag to <span> tagsin the
XHTML format.
<div> tags are invalid children of inline tags but are common when
pasted.

Currently <code> tags are split to fix this which isn't a good UX
so this fixes that.
2021-10-13 18:07:16 +01:00
Sam
19d6126407 Update undo plugin (#830)
Updates the undo plugin to use the native input event and also to patch
the methods that allow programmatically inserting content into the
editor.
2021-10-13 17:53:37 +01:00
Sam
60d47efc8a Update PR #821 (#850)
* Remove MatchingMode enum
See comments in PR. This is harder to type and has no benefits in JS.
Aiming to remove them in next others in next release so not adding new ones.

* Remove 2 from being a value for matchAttrs
2 is not a vlaid option for matchAttrs .

* Remove isObject function
Handler attributes should be an object or falsey
so no need to check if plain object.

* Allow chaning BBCode format after editor creation
Maintains backwards compatibility until next breaking release
2021-10-13 00:10:51 +01:00
Sam
b53ca89741 Add CodeQL code scanning 2021-10-12 23:32:32 +01:00
f51788fe83 Update extend to stop LGTM error & improve clarity.
LGTM complains about prototype pollution event though it is prevented.
It seems to not recognise the combined if statment.

Also makes it a little easier to
read and slightly reduces the code size.
2021-10-12 23:29:04 +01:00
81879def1c Simplify trim() regex.
The first \r\n replace is matched by [^\S] so not needed.
The | in the second regex is not needed either.
2021-10-12 00:25:51 +01:00
Sam
bb400294aa Use innerText to convert HTML to text (#848)
Normalises node first as innerText will add extra line breaks otherwise.
Fixes #839
2021-10-11 18:15:06 +01:00
b3bd477c92 Simplify bug report template 2021-06-27 20:45:24 +01:00
Sam
042ddbded8 Fix whitespace being wrapped (#835)
Should only wrap whitespace nodes when wrapping other nodes.
Prevents extra newlines being insert from wrapping collapsed whitespace.
2021-06-25 01:35:10 -07:00
6cdfc5a80b initialize plugins before the formatters (#822)
Plugins should be initialized before the formatters since they may wish to add or change formatting handlers and since the bbcode format caches its handlers, such changes must be done first.
2021-06-25 01:26:05 -07:00
Sam
576c691c90 Improve fixNesting() (#820)
* Make fixNesting split <p> tags containing <blockquotes>

* Prevent fixNesting from creating empty nodes

* Fix nesting after inserting HTML

* Update fixNesting to copy inline styling

* Don't remove empty node that contain <br /> tags

* Prevent empty nodes being created when inserting

* Remove dev comments
2021-06-25 01:23:56 -07:00
ff8fcf97f2 Add ability to match all attrs in a given tag (#821)
New option added `instance.opts.parserOptions.matchAttrs`
New enumerable added: `sceditor.BBCodeParser.MatchingMode`

The enum has two values:

- `sceditor.BBCodeParser.MatchingMode.all`
- `sceditor.BBCodeParser.MatchingMode.any`—this is the value which will be used if left blank, ie, not set. This way, any existing code will still work exactly as before.

Each individual format option will have the opportunity to specify its own `matchAttrs` and override the global option.
2021-06-25 01:18:30 -07:00
2e7a43d924 Slovak translation (#838)
* Slovak translation
2021-06-01 16:04:17 +01:00