Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mode HTMLEbmedded Doesn't Work #2

Open
william-voyek opened this issue Dec 20, 2017 · 9 comments
Open

Mode HTMLEbmedded Doesn't Work #2

william-voyek opened this issue Dec 20, 2017 · 9 comments

Comments

@william-voyek
Copy link

Trying to print a HTML Embedded file doesn't work and returns an error Uncaught TypeError: CodeMirror.multiplexingMode is not a function. To resolve include the addon/mode/multiplex library.

@nobuhito
Copy link
Owner

Thank you for your request.
However, I do not understand the relationship between "Mode HTMLEbmedde" and "multiplexingMode".
Please let me know the code you want to print.

@william-voyek
Copy link
Author

william-voyek commented Dec 21, 2017

You just need to include the addon/multiplex library:

<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.31.0/addon/mode/multiplex.min.js"></script>

So when mode == 'htmlembedded' include the multiplex library. It's script tag will need to come before the htmlembedded library's script tag.

@nobuhito
Copy link
Owner

nobuhito commented Dec 22, 2017

Perhaps it will be the desired behavior.

However, I want to know the behavior before the modification and the behavior after the modification before adding the code.

I'd like to test with the code below, so please tell me the VS Code Extension that will be mode == 'htmlembedded'. It seems that it can not be specified with standard VSCode.

<%
function hello(who) {
	return "Hello " + who;
}
%>
This is an example of EJS (embedded javascript)
<p>The program says <%= hello("world") %>.</p>
<script>
	alert("And here is some normal JS code"); // also colored
</script>

http://codemirror.net/mode/htmlembedded/

@william-voyek
Copy link
Author

william-voyek commented Dec 28, 2017

I'm not entirely certain of what you are asking me for so I'm just going to guess that you are wanting to know what file/mime type I'm seeing this behavior with. I'm editing Classic ASP with the file extension of .asp.

It looks like all of the following extensions are detected as HTMLEmbedded by your code:

.ejs
.erb
.aspx
.asp
.jsp

@nobuhito
Copy link
Owner

I could not reproduce it.

image

image

I can help you solve if you can show actual code.

@william-voyek
Copy link
Author

Sure, I've attached a sample.
nav_menu_online.asp.zip
screen shot 2017-12-28 at 5 03 36 pm
screenshot 2017-12-28 17 05 00

@william-voyek
Copy link
Author

This is what it looks like if I manually add the <script> tag to the temp file:
screenshot 2017-12-28 17 08 33

@nobuhito
Copy link
Owner

nobuhito commented Jan 1, 2018

All solved. There is no problem with the display contents.

2018-01-01 11 58 31

Thank you for helping reporting and fixing bugs.

@aditya-raj-cap
Copy link

aditya-raj-cap commented May 3, 2019

I do not think the issue is resolved.
I am still getting a look similar to this after adding the multiplex.min.js and no text without it.
I am using mode:"application/x-aspx" as given on the official website (https://codemirror.net/mode/htmlembedded/index.html).
Basically there is no highlighting when I use the given mode and the following scripts:

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.46.0/mode/htmlembedded/htmlembedded.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.46.0/addon/mode/multiplex.min.js"></script>

This is what it looks like if I manually add the <script> tag to the temp file:
screenshot 2017-12-28 17 08 33

@nobuhito nobuhito reopened this May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants