user3242743
user3242743

Reputation: 1851

Ckeditor formatting is not displayed after saving

i am using CKeditor as a text editor in my rails app. so i just download it from the website, then included it. I added this code too:

<script type="text/javascript">$(document).ready(function() {
    if ($('textarea').length > 0) {
        var data = $('textarea');
        $.each(data, function(i) {
            CKEDITOR.replace(data[i].id);
        });
    }
});</script>

The problem is that when i save the content of the text area in the database, and display it after this, from my database, the formatting disappears (for example, what i underlined, is not underlined anymore..)

What can be the problem?

Upvotes: 0

Views: 693

Answers (1)

Joel Peltonen
Joel Peltonen

Reputation: 13432

If your content is underlined with a class and not the <u> tag, it might be that you are missing the CSS that makes the class underlined. Meaning if in your content you have something like this: <span class="Underline"> Dr. Whooves </span>, you need the CSS rule for the Underline class to make the underline effective - something like .Underline { text-decoration: underline; }.

Another reason might be that something is overriding the underline tag, whatever it is. Inspect the content that should be underlined using your browser Developer Tools and check the effective style and the overwritten styles.

It would help in troubleshooting if you could provide what your content looks like. A small example of the HTML you produce. Also it might help to show the code you use to output the HTML, but in this case it might not be relevant.

Upvotes: 2

Related Questions