Commit aec2c12e authored by Eduardo Bonet's avatar Eduardo Bonet

Highlighting transformed ipynb diffs

parent 22cb2366
......@@ -27,7 +27,7 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated
Gitlab::Highlight.highlight(
blob.path,
transformed_blob_data,
language: language,
language: transformed_blob_language,
plain: plain
)
end
......@@ -120,6 +120,10 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated
blob.language_from_gitattributes
end
def transformed_blob_language
@transformed_blob_language ||= blob.path.ends_with?('.ipynb') ? "md" : language
end
def transformed_blob_data
@transformed_blob ||= if blob.path.ends_with?('.ipynb')
new_blob = IpynbDiff.transform(blob.data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment