Giter Club home page Giter Club logo

ckeditor-plugins's People

Contributors

aholtkamp avatar aprantl avatar coremedia-ci avatar jensdallmann avatar mmichaelis avatar pkliesch avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

ckeditor-plugins's Issues

Image Blobs Don't Render when Loaded From Data

Describe the bug

When image blobs are referenced in data, like:

<img alt="Alternative Text: Red Image" xlink:href="content/900#properties.data"/>

They are not display anymore since CKEditor Plugins Release 5.0.0. In example data (for example "Various Images" you will see a broken image instead)

To Reproduce

Steps to reproduce the behavior:

  1. Open Example Application
  2. Select "Various Images" from example data.

Expected Behavior

The image is loaded from service and displayed within CKEditor.

Actual Behavior

The image is shown as a broken image with "HTML object" tag rendered on top.

Environment (please complete the following information):

  • OS: iOS, Windows
  • Browser: Chrome, Firefox
  • CKEditor Version: 34.0.0
  • CoreMedia's CKEditor Plugins Version: 5.0.0

Additional context

  • Data-Processing correctly applies a dummy image (required, as blob data are retrieved lazily from backend).

  • Image in Model is represented as:

    <htmlImg
      htmlAttributes="{attributes:{alt:"Alternative Text: Red Image", "data-xlink-href": "content/900#properties.data"}}"
      htmlContent="">
    </htmlImg>
    

    Thus, it is the GHS Plugin which kicks in here, and handles an unknown "img" element.

  • Expectation is, that it is related to recent CKEditor Update, introduced with:

Singleton Paragraphs in Tables Removed

Describe the bug

If there is just one paragraph within a table data cell <td>, it is removed within CKEditor processing, which reflects this architectural decision:

The table feature allows for creating block content (like paragraphs, lists, headings, etc.) inside table cells. However, if a table cell contains just one paragraph and this paragraph has no special attributes (like text alignment), the cell content is considered β€œinline” and the paragraph is not rendered.

(See Tables - CKEditor 5 Documentation).

While this may be desirable, all CoreMedia RichText created with CKEditor 4 comes with paragraphs (always). Thus: While CoreMedia RichText DTD considers singleton paragraphs as valid just as just plain characters within <td>, processing in CKEditor may remove this <p>. This may cause subtle different results in rendering CoreMedia RichText later on, thus, it is considered a bug.

To Reproduce

Steps to reproduce the behavior:

  1. Go to Example App.

  2. Set the following data in source editing:

    <?xml version="1.0" encoding="utf-8"?>
    <div xmlns="http://www.coremedia.com/2003/richtext-1.0"><table><tbody><tr><td><p>Lorem</p></td></tr></tbody></table></div>
  3. Store Data

  4. Reopen source editing.

Expected Behavior

Paragraph should be kept as is (the same: if there is none, no paragraph should be added).

Actual Behavior

Singleton paragraph is always removed according to the requirement stated above.

Possible Workaround

On data-processing add some attribute to the paragraph, so that it isn't removed as being obsolete.

Environment (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Browser Version: 99.0
  • CKEditor Version: 32.0.0
  • CoreMedia's CKEditor Plugins Version: 4.0.1

Chained Reserved Classes "underline strike" ignores "underline"

πŸ“ Describe the Bug

A clear and concise description of what the bug is.

πŸ‘£ Reproduction Steps

Steps to reproduce the behavior:

  1. In source editing paste:

    <?xml version="1.0" encoding="utf-8"?>
    <div xmlns="http://www.coremedia.com/2003/richtext-1.0">
        <p>
            Hello <span class="strike underline">World</span>!
        </p>
    </div>

    where underline and strike refer to the reserved classes to be mapped to <u> and <s> respectively.

  2. Switch to editing mode.

βœ” Expected Result

Ideally, editing view should contain for the relevant part:

<p>
  Hello <s><u>World</u></s>!
</p>

❌ Actual Result

Editing view only keeps the "strike" state:

<p>
  Hello <s>World</s>!
</p>

No traces left for "underline".

πŸ“ƒ Environment

  • OS: Windows
  • Browser: Chrome
  • Browser Version: 105.0.5195.128
  • CKEditor Version: 35.1.0
  • CoreMedia's CKEditor Plugins Version: 9.1.0
  • Installed CKEditor Plugins: CoreMedia RichText

If you'd like to see this fixed sooner, add a πŸ‘ reaction to this post.

CoreMedia General RichText Support: Wrong Documentation as Not Being Part of Essentials

πŸ“ Describe the Bug

Documentation states, that this plugin is not part of the Studio Essentials Plugin:

**Not part of CoreMedia Essentials:** This plugin is not part of the
_CoreMedia Essentials_, as it depends on your use-case, if you prefer running
CKEditor 5 in CoreMedia CMS with or without it.

This is wrong. It is one of the two important plugins integrated into Studio Essentials Plugin.

πŸ“ƒ Environment

  • CoreMedia's CKEditor Plugins Version: 9.0.1

If you'd like to see this fixed sooner, add a πŸ‘ reaction to this post.

Text Within Greater-Than/Less-Than Entities vanishes

If you try to store a text such as:

Lorem <Ipsum> Dolor

You will end up with the following being stored as data:

Lorem Dolor

πŸ”Ž Analysis

As it seems, this behavior is the result of:

public decodeHtmlEntities(): void {
// noinspection InnerHTMLJS
this.decodeElement.innerHTML = this.textContent;
const newText = this.decodeElement.textContent;
// noinspection InnerHTMLJS
this.decodeElement.innerHTML = "";
// Prevent possible cycles, if re-applying rules because of a recreated
// text node.
if (newText !== this.textContent) {
this._text = newText || "";
}
}

Taken from Stack Overflow:

Even the original fiddle has issues with texts such as Hello &lt;nice&gt; World and will end up as Hello World.

🩹 Fix?

  • Find a new way of resolving entities, or
  • don't resolve them, but make the entities available an CoreMedia RichText known to the whole processing.

Link Plugin: Dropping two subsequent content links will merge them, ignoring target of second

Describe the bug

When dropping two (or more links) one after another at the end of the text, both links will be merged into one having only one target.

To Reproduce

Steps to reproduce the behavior:

  1. Open Example App
  2. Empty Content (easier to reproduce)
  3. Open Drag Examples
  4. Drag first content
  5. Drag second content "at the end", thus, the mouse cursor far to the right
  6. See error

Expected Behavior

A second link is created with its text added right behind the previous link. Both parts have a different link target.

Actual Behavior

Text of the second link is written, but the attributes, especially the link's target, is only taken from the first dropped link.

Environment (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Browser Version: 99.0
  • CKEditor Version: 32.0.0
  • Plugins Version: 4.0.0

Link Plugin: On multiple content drop, cursor placed behind first loaded content

Describe the bug

When you drag and drop several contents into CKEditor, the editing position will be set right after the first dropped (and loaded) content.

To Reproduce

Steps to reproduce the behavior:

  1. Open Example App
  2. Empty Editor
  3. From Drag Examples, choose one with various contents (like Slow/Fast/Slow)
  4. See error

Expected Behavior

Contents are added line by line and the cursor is either in a new line after all contents dropped, or right at the end of the last content (typing shall not continue link, but just write text).

Actual Behavior

Editing cursor appears behind first loaded content (in case of Slow/Fast/Slow right behind the fast content).

Environment (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Browser Version: 99.0
  • CKEditor Version: 32.0.0
  • CoreMedia's CKEditor Plugins Version: 4.0.0

Link Plugin: Remove Content Link in Form View leaves raw content:<number> in input field

Describe the bug

When editing an existing content-link and deciding to remove the link in form view, the raw model value content:42 is displayed in the link form view:

content-link-issue

To Reproduce

Steps to reproduce the behavior:

  1. Open Example-App
  2. Open Content Link Examples
  3. Start Editing a Content Link Target
  4. Press "Remove" (aka Cancel) button in link form view.

Expected Behavior

Input field is completely empty afterwards.

Actual Behavior

The displayed link is removed and replaced by its raw model value: content:42.

Environment (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • Browser Version: 104.0.5112.102
  • CKEditor Version: 34.2.0
  • CoreMedia's CKEditor Plugins Version: 8.0.0

RichTextDataProcessor: Duplicates <br/> on toView Processing

When transforming a <br/> from CoreMedia RichText to view, the <br/> is essentially duplicated here:

toView(data: string): ViewDocumentFragment | null {
const logger = RichTextDataProcessor.#logger;
const startTimestamp = performance.now();
const dataDocument = this._domParser.parseFromString(declareCoreMediaRichText10Entities(data), "text/xml");
this._toViewFilter.applyTo(dataDocument.documentElement);
const documentFragment = dataDocument.createDocumentFragment();
const nodes: Node[] = Array.from(dataDocument.documentElement.childNodes);
documentFragment.append(...nodes);
const html: string = this._htmlWriter.getHtml(documentFragment);
if (logger.isDebugEnabled()) {
logger.debug(`Transformed RichText to HTML within ${performance.now() - startTimestamp} ms:`, {
in: data,
out: html,
});
}
return this._delegate.toView(html);
}

The debugging output will reveal, that the BasicHtmlWriter by CKEditor transforms the <br/> in the document fragment to <br></br> which in subsequent processing is transformed to <br/><br/>.

This may be a CKEditor issue, or we need to fix the serialization in some way. As a patch, we may want to just handle these occurrences specifically by search & replace. Or, we should consider using for example the XMLSerializer as we do in corresponding tests.

Note, that this also affects the current approach for General RichText Support (GRS) based on CKEditor's General HTML Support (GHS), as any class attribute is removed in this processing: #35.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.