Skip to content

Commit

Permalink
Merge pull request #457 from rtfpessoa/fix-side-by-side-margins-highl…
Browse files Browse the repository at this point in the history
…ight-overrides

fix side by side margins and highlight usage of object instead of map
  • Loading branch information
rtfpessoa authored Oct 30, 2022
2 parents 59ff295 + 5ca9d22 commit 35008fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/ui/css/diff2html.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@
overflow-x: scroll;
overflow-y: hidden;
width: 50%;
margin-right: -4px;
margin-bottom: -8px;
}

.d2h-code-line {
Expand Down
4 changes: 4 additions & 0 deletions src/ui/js/diff2html-ui-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ export class Diff2HtmlUI {

const language = file.getAttribute('data-lang');

if (!(this.config.highlightLanguages instanceof Map)) {
this.config.highlightLanguages = new Map(Object.entries(this.config.highlightLanguages));
}

const hljsLanguage =
language && this.config.highlightLanguages.has(language)
? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
Expand Down

0 comments on commit 35008fb

Please sign in to comment.