Skip to content

Instantly share code, notes, and snippets.

/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
/* global document, console, window */
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import EnterPlugin from '@ckeditor/ckeditor5-enter/src/enter';
import TypingPlugin from '@ckeditor/ckeditor5-typing/src/typing';
@mlewand
mlewand / 4504-tc.html
Created November 19, 2019 14:14
Sample markup used for performance testing of issue #4504 in CKE5
<div id="editor">
<p><code><i><s><strong><sub><sup><u>You can use the remove format feature to easily clean up text formatting.</u></sup></sub></strong></s></i></code></p><p><code><i><s><strong><sub><sup><u>Some examples of the formatting removed by this feature: bold, italics, underline, strikethrough, code, subscript, superscript, </u></sup></sub></strong></s></i></code><span class="text-tiny"><code><i><s><strong><sub><sup><u>font size</u></sup></sub></strong></s></i></code></span><code><i><s><strong><sub><sup><u> as well as </u></sup></sub></strong></s></i></code><span style="font-family:'Courier New', Courier, monospace;"><code><i><s><strong><sub><sup><u>font family</u></sup></sub></strong></s></i></code></span><code><i><s><strong><sub><sup><u>.</u></sup></sub></strong></s></i></code></p><p style="text-align:center;"><code><i><s><strong><sub><sup><u>Remove format resets the text alignment too.</u></sup></sub></strong></s></i></code></p><p><code><i><s><strong><sub><sup><u>Note: The feature will not erase
@mlewand
mlewand / custom.css
Last active October 29, 2019 09:07
My customization to GitHub Ice Dark theme for Stylish chrome extension.
button[type="button"].repository-lang-stats-graph {
background: transparent !important;
opacity: 0.5 !important;
}
.hook-delivery-container pre {
background-color: inherit;
}
div.gh-header, .gh-header .gh-header-sticky.is-stuck+.gh-header-shadow, .pagination-loader-container {

CKE5 - CKS sync 2019-05-20

@mlewand
mlewand / destroy2.js
Created July 26, 2018 11:56
A sample code to break CKE4 mode creation
/* bender-tags: editor,unit */
/* bender-ckeditor-plugins: divarea */
( function() {
'use strict';
bender.test( {
// (#2257)
'test destroy editor on instance created': function() {
var editor = CKEDITOR.replace( 'destroyed' ),
@mlewand
mlewand / renderRect.js
Last active July 31, 2023 09:16
DOMRect visualisation - a small helper for visualizing DOMRect objects.
( function() {
/**
* A helper function to visualize DOMRect or set of DOMRect instances.
*
* Subsequent calls will remove previously marked elements.
*
* Debug a element currently focused in your devtools inspector.
* window.markRect( $0.getBoundingClientRect() );
* // Debug a selection.
* window.markRect( document.getSelection().getRangeAt( 0 ).getClientRects() );
@mlewand
mlewand / wordPaste.html
Created December 27, 2017 16:45
An example clipboard data for CKEditor4 issue #1362
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 11">
<meta name=Originator content="Microsoft Word 11">
@mlewand
mlewand / notes.md
Last active October 23, 2017 14:29
Notes to an overview of hub CLI tool.
@mlewand
mlewand / 859.js
Last active September 19, 2017 08:21
CKEditor issue #895 unit test
/* bender-tags: editor */
/* bender-ckeditor-plugins: link,toolbar */
( function() {
'use strict';
bender.editor = {
config: {
autoParagraph: false,
extraAllowedContent: 'span[style];img[*]'
@mlewand
mlewand / Untitled-1
Created April 1, 2017 18:43
A log created by VSCode debugger running with Karma
OS: win32 ia32
Adapter node: v6.5.0 ia32
vscode-chrome-debug-core: 3.14.10
8:40:36 PM, 4/1/2017
debugger-for-chrome: 2.7.1
From client: initialize({"clientID":"vscode","adapterID":"chrome","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"exceptionBreakpointFilters":[{"label":"All Exceptions","filter":"all","default":false},{"label":"Uncaught Exceptions","filter":"uncaught","default":true}],"supportsConfigurationDoneRequest":true,"supportsSetVariable":true,"supportsConditionalBreakpoints":true,"supportsCompletionsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsRestartFrame":true,"supportsExceptionInfoRequest":true,"supportsRestartRequest":true}}
From client: attach({"type":"chrome","request":"attach","name":"Attach Karma Chrome","address":"localhost","port":9333,"trace":true,"pathMappin