Giter VIP home page Giter VIP logo

Comments (11)

TopCoder02 avatar TopCoder02 commented on May 29, 2024 3

@TheSpyder

It happens in both 6 and 7.

Here's a fiddle:
https://fiddle.tiny.cloud/fVQGGgyZ0B/4

It shows both issues, the conversion to black and ignoring the style tags.

Source View
image

WYSIYG View
image

** Edit: I updated the fiddle and images to be more clear to explain what I mean

from tinymce.

TopCoder02 avatar TopCoder02 commented on May 29, 2024 2

I doing this in the meantime, it only addresses the issue of transparent being converted to black. The issue where it ignores and doesn't force HEX colors in the style tags, this won't address.

 editor.on('BeforeSetContent', function (e) {
         e.content = e.content.replace(/((color|background-color|border-color)\s*:\s*|background\s*:[^;]*?)\btransparent\b/g, '$1#00000000');
 });

from tinymce.

Alexander-Jordan avatar Alexander-Jordan commented on May 29, 2024 2

I can confirm the issue after upgrading to v7.0.0.
Maybe because the option was removed entirely and forced now?
Is there a way of not enforcing it via the init config?

EDIT: this solved my issue as well:

editor.on('BeforeSetContent', function (e) {
  e.content = e.content.replace(
    /((color|background-color|border-color)\s*:\s*|background\s*:[^;]*?)\btransparent\b/g,
    '$1#00000000'
  );
});

from tinymce.

TheSpyder avatar TheSpyder commented on May 29, 2024 1

Which version? A replication case will help a lot. Although the option is named "force hex color", the fact that it forces the color value to hex seems to be by design.

The option was added to solve a regression between TinyMCE 5 and 6, but we couldn't revert it as that would be a breaking change. We're looking at a proper fix for TinyMCE 7, so your feedback and an example would be much appreciated.

from tinymce.

nazar-kalinichenko avatar nazar-kalinichenko commented on May 29, 2024 1

I can confirm the issue existing in v7.0.0. We are using @tinymce/tinymce-react.

@TopCoder02's approach has helped.

from tinymce.

spocke avatar spocke commented on May 29, 2024 1

Confirmed this as a bug and a regression so escalating internally.

from tinymce.

jimetevenard avatar jimetevenard commented on May 29, 2024 1

Also encoutered it.

To summarize for people passing by (correct me if Iโ€™m wrong)

  • The bug already exists in 6.x (if you the force_hex_color option)
  • Moste people will encouter this bug when switching to 7.x (since the force_hex_color behavior is now enforced)

Anyway, thanks guys for your reactivity,
Tiny rocks ! ๐Ÿ˜Ž

from tinymce.

TheSpyder avatar TheSpyder commented on May 29, 2024

yes we haven't implemented the change yet so 7-dev will be the same as 6.

from tinymce.

TheSpyder avatar TheSpyder commented on May 29, 2024

Confirmed fixed in the next release. #9414

This can be confirmed using the 7-dev channel on fiddle.tiny.cloud

from tinymce.

TopCoder02 avatar TopCoder02 commented on May 29, 2024

@TheSpyder This changed doesn't address any of the issues reported here.

from tinymce.

TheSpyder avatar TheSpyder commented on May 29, 2024

Huh. I thought it was rolling back to the v5 implementation, but I see what you mean. Apologies.

from tinymce.

Related Issues (20)

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.