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

Extension causes weird random source-code to appear. #7

Open
theMomax opened this issue Dec 27, 2019 · 3 comments
Open

Extension causes weird random source-code to appear. #7

theMomax opened this issue Dec 27, 2019 · 3 comments

Comments

@theMomax
Copy link

If I have this extension enabled, some random javascript code appears on top of the editor when I select specific words. E.g. the "to" in the image below.

image

@psixdev
Copy link

psixdev commented Jan 9, 2020

I confirm, I suffered for a long time from this problem. Now he finally decided to figure out the extension by turning off everyone in turn.

The code appears when I highlight the words "map", "filter". It disappears when I highlight "false", numeric values.

@PaulBurridge
Copy link

Using developer tools discovered the element responsible:

image

@PaulBurridge
Copy link

Doe a little digging, the onSelection function calls math.eval(editor.document.getText(editor.selection) for certain strings (e.g. "eval", "map") it returns a function which is then converted into a string resulting in function code on screen.

https://mathjs.org/ has a notepad that does live eval which it converts to just the word "function" I would suggest adding logic to do the same.

image

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