简体   繁体   English

中型编辑器-粗体按钮/键盘快捷键不起作用

[英]Medium Editor - Bold button/keyboard shortcut not working

I've installed Medium Editor on our site, on two different pages. 我已经在我们网站的两个不同页面上安装了Medium Editor They both work fine, and are initialised with the exact same code, but on one of pages the Bold button/shortcut doesn't work. 它们都可以正常工作,并且使用完全相同的代码初始化,但是在其中一页上,粗体按钮/快捷方式不起作用。

The page on which it doesn't work gets a lot more styling (and has a lot more js libraries) compared to the one that does work, and so I'm wondering if something else might be getting in the way. 与不起作用的页面相比,不起作用的页面具有更多的样式(并且具有更多的js库),因此,我想知道是否还有其他问题。

I can't see any js errors in the console. 我在控制台中看不到任何js错误。 Has anyone encountered this problem? 有没有人遇到这个问题? I saw another forum post saying it was something to do with styling on font-weight , but I can't see how this would actually stop the function working completely: it just seems to be disabled - the "B" button in the Medium Editor's popup menu doesn't change color when you click on it. 我看到另一个论坛上的帖子说这与font-weight上的样式有关,但是我看不到这实际上将如何完全停止该功能的工作:它似乎被禁用了-Medium Editor中的“ B”按钮弹出菜单在单击时不会改变颜色。

If it was a css issue I'd expect the button to change color but the text to not look different, perhaps, but it does just seem like "Bold" is disabled. 如果是css问题,我希望按钮可以更改颜色,但是文本看起来并没有什么不同,但这似乎只是禁用了“粗体”。 Also, any tags already in the content's html do display ok. 另外,内容的html中已经存在的所有标签都显示为ok。

Has anyone else encountered this, or other functions seemingly not working? 其他人是否遇到过此问题,或者其他功能似乎不起作用?

EDIT: I just poked it some more and noticed that if something is bold already, and I highlight it, the B button does look activated, and and I can "unbold" it. 编辑:我只是捅它多一些,发现如果事情是已经大胆,我选中它,B键看起来激活我可以“取消粗体”吧。 However, after unbolding the selected text, I can't "bold" it again. 但是,取消选中所选文本后,我将无法再次“加粗”该文本。

EDIT2: More poking has revealed that if the highlighted text is set to be a heading, or is italicised, then I can bold and unbold it as intended. EDIT2:更多的戳戳表明,如果突出显示的文本设置为标题或斜体,则可以按预期将其加粗和不加粗。 So it's really just "normal" text which seems to be "bold-resistant". 因此,实际上只是“普通”文本,似乎是“抗粗体”。

I found the answer - the problem page had the text area inside a label tag, and so was picking up the styling for label across the site, which had font-weight: 700 . 我找到了答案-问题页面的标签标记内有文本区域,因此在整个网站上选择了label样式, font-weight: 700 This was preventing Medium Editor from applying the Bold style to it. 这阻止了中型编辑器对其应用粗体样式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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