简体   繁体   中英

  being generated in P tags by browser

I've been building a wordpress site from a theme for a little while now and noticed that in certain instances in the p tags   characters are being generated by either the browser or the CSS. Don't really know which one though, but it's getting annoying since it's messing up the type.

I recently added

.entry-content {
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;
    word-wrap: normal;
}

to prevent hyphenation from happening, but I think this might be related to the updated CSS or the "Visual Composer" editor that I'm forced to use with this theme.I've already confirmed that I don't have   in the editor which I hoped would be the problem.

Any help would be greatly appreciated!

Thanks!

Firstly,   entities are space characters, not hyphens. Secondly, the CSS is not generating those, it is WordPress that generates extra markup. This may be a result of the WYSIWYG editor, or the theme itself, but it is impossible to know based on your question.

You can use the following code to prevent WordPress from creating extra markup:

remove_filter('the_content', 'wpautop');
remove_filter('the_excerpt', 'wpautop');

But, the problem is also likely with a related plugin. Try disabling all plugins and see if the problem still arises.

This non-   character is actually   , which Chrome and Safari will render as   , but display as " " from within the inspector edit feature, the source code, and the WYSIWYG editor.

The full explanation is from Remy Lebeau where he goes through the HEX code. Going back through the code and simply retyping everything to use the traditional space fixed the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM