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

Allow .iix file type for images if .iix is in the imageAccept property #575

Open
robhumphries5 opened this issue Dec 20, 2023 · 1 comment

Comments

@robhumphries5
Copy link

Is your feature request related to a problem? Please describe.
I am using EasyMDE with ServiceNow and images are stored at paths ending with .iix.
EasyMDE is interpreting these as links.
I understand .iix is not necessarily an image, but in this case I am also explicitly using the "Import an Image" action and I have added image/iix to the imageAccept property of the editor.

Describe the solution you'd like
EasyMDE to process .iix link paths as images if .iix is in the imageAccept property

Describe alternatives you've considered
There are alternatives in ServiceNow like creating an endpoint that converts requests for /abc.png to /abc.iix and return the result.

Additional context
N/A

@robhumphries5
Copy link
Author

I have added a workaround like this but it would be nice if iix was supported

editor.codemirror.on("changes",function(event){
	var value = event.getTextArea().value;
	var regex = /[^!]\[[a-z0-9]{32}\.iix/gm;
	var linksThatShouldBeImages = value.match(regex);
	if(!linksThatShouldBeImages){
		return;
	}
	linksThatShouldBeImages.forEach(function(link){
		var firstChar = link.substring(0,1);
		var rest = link.substring(1,link.length);
		value = value.replace(link,firstChar+"!"+rest);
	});
	editor.value(value);
	
});

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

1 participant