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

Fix 1638, adding support dynamic loading marked.sj with fallback for v<6 #1639

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

johnjbarton
Copy link

In v6 jupyter notebook components/marked/lib/marked no longer exists. The extension silently falls over.

Add local copy of marked.min from cdnjs.com into the /python-markdown directory.

require() 'marked' on two paths,
first expecting marked.min.j in the same dir,
second expecting marked in the v6 compenents/ location.

Insert ERROR message in user page if neither is found.

@johnjbarton
Copy link
Author

I only verified this works for me on:
jupyter_client : 8.2.0
jupyter_core : 5.3.0
jupyter_server : 2.5.0

@juhasch
Copy link
Member

juhasch commented May 8, 2023

Great, thanks a lot for the PR!
I think it is the right approach to include marked.js directly and not dynamically load it over a CDN.
We should probably include the license for marked from https://github.com/markedjs/marked/blob/master/LICENSE.md.

@johnjbarton
Copy link
Author

CDN: the link in the commit description is just doc. The min.js file is in the directory.

license: just copy into the directory? as marked_LICENSE.md?

…d.js

In v6 jupyter notebook components/marked/lib/marked no longer exists. The extension silently falls over.

Add  https://cdnjs.com/libraries/marked for local loading into the python-markdown directory.

Change required path and calls marked -> marked.marked.

Add 6.x to yaml compat setting
@johnjbarton
Copy link
Author

Now that I understand the system a bit better I removed the dynamic load. The fix is simple now and should work for 5x and 6x.

The marked.min.js file includes these lines:

 * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)
 * https://github.com/markedjs/marked

@johnjbarton
Copy link
Author

I'm hoping someone can take a look before I forget all the details here.

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

Successfully merging this pull request may close these issues.

2 participants