From 0ef9eb56f72b574e7476a8dd9f3aa0a057bd278d Mon Sep 17 00:00:00 2001 From: AdamBear Date: Wed, 19 Jan 2022 21:59:52 +0800 Subject: [PATCH] simple workaround to view .md file rendered --- notebook/static/tree/js/notebooklist.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/notebook/static/tree/js/notebooklist.js b/notebook/static/tree/js/notebooklist.js index 3f1f96a284..b2a703f046 100644 --- a/notebook/static/tree/js/notebooklist.js +++ b/notebook/static/tree/js/notebooklist.js @@ -1243,7 +1243,11 @@ define([ that.selected.forEach(function(item) { var item_path = utils.encode_uri_components(item.path); var item_type = that._is_notebook(item) ? 'notebooks' : that._is_viewable(item) ? 'view' : 'files'; - window.open(utils.url_path_join(that.base_url, item_type, item_path), IPython._target); + if (includes_extension(item.path, ['md'])){ + window.open(utils.url_path_join(that.base_url, 'nbextensions/nbextensions_configurator/rendermd/files', item_path), IPython._target); + }else { + window.open(utils.url_path_join(that.base_url, item_type, item_path), IPython._target); + } }); };