Codemirror settings dont work in SummernoteInplaceWidget.
See original GitHub issueIn my form I use SummernoteInplaceWidget
.
I have 2 problems:
-
I notice that when I open form bold button in toolbar is always active. I notice this bug in Firefox Mozilla but in other browsers it works fine. Also when I click to text which is without any style bold button became active. I notice this bug only in Firefox Mozilla. What do you this about that?
-
Why next my settings dont change codemirror? I want to add colors and line numbers. What can you advice to me? Where is my mistake?
I want codemirror like this:
settings.py:
SUMMERNOTE_CONFIG = {
'css': {
'//cdnjs.cloudflare.com/ajax/libs/codemirror/5.29.0/theme/monokai.min.css',
},
'codemirror': {
'mode': 'htmlmixed',
'lineNumbers': 'true',
'theme': 'monokai',
},
}
I load static files in template cause when I tried to set static files in settings.py file it raise error. CSS:
<link rel="stylesheet" type="text/css" href="{% static "summernote/summernote.css" %}">
<link rel="stylesheet" type="text/css" href="{% static "summernote/django_summernote.css" %}">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/theme/monokai.css">
JS:
<script src="{% static 'summernote/jquery.ui.widget.js'%}"></script>
<script src="{% static 'summernote/jquery.iframe-transport.js'%}"></script>
<script src="{% static 'summernote/jquery.fileupload.js'%}"></script>
<script src="{% static 'summernote/summernote.min.js'%}"></script>
<script src="{% static 'summernote/ResizeSensor.js'%}"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/xml/xml.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/2.36.0/formatting.js"></script>
Right now I have this:
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
CodeMirror 5 User Manual
See below for a full discussion of the configuration options that CodeMirror accepts. In cases where you don't want to append the editor...
Read more >Can't get autoCloseTags to work with custom options
I've been trying to add the autoCloseTags addon into my editor. But I'm unable to figure out a way to prevent the autoCloseTags...
Read more >CodeMirror System Guide
On the less bright side, this means that setting up an editor requires you to put ... of the current viewport will not...
Read more >Example: Configuration - CodeMirror
Code using the history doesn't have to worry about that though—it can just drop the extension value produced by the function into its...
Read more >Toggling Extensions - CodeMirror
Say I want to provide editor settings to a user, such as: The language used Show/hide line numbers ... It also doesn't work...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In summernote.org page widget works fine. I use Firefox 57.0.1 (64 bit).
Right now I notice that in my project I have this style:
When I disable this style bold button do not active. I think Firefox render page differently from other browsers. Its strange cause 100-500 is normal, and 600-900 bold. As you can see I use 500. I changed to 400 and now it works fine.
Keep me posted on any developments, pls? 😃