Skip to content

Commit

Permalink
feat: syntax highlighting for yaml/docker (#88)
Browse files Browse the repository at this point in the history
Closes #86
Closes #87
  • Loading branch information
stanistan authored Jul 10, 2023
1 parent 1c4a418 commit 1fd0ece
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions frontend/components/DiffBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ Prism.manual = true;
// these are the supported languages in general
import 'prismjs/components/prism-bash';
import 'prismjs/components/prism-toml';
import 'prismjs/components/prism-css';
import 'prismjs/components/prism-diff';
import 'prismjs/components/prism-docker';
import 'prismjs/components/prism-go';
import 'prismjs/components/prism-json';
import 'prismjs/components/prism-markdown';
import 'prismjs/components/prism-markup-templating';
import 'prismjs/components/prism-php';
import 'prismjs/components/prism-scss';
import 'prismjs/components/prism-rust';
import 'prismjs/components/prism-go';
import 'prismjs/components/prism-sass';
import 'prismjs/components/prism-scss';
import 'prismjs/components/prism-toml';
import 'prismjs/components/prism-yaml';
// this gets us the fancier diff-highlighting
import 'prismjs/plugins/diff-highlight/prism-diff-highlight';
Expand All @@ -36,7 +40,7 @@ const props = defineProps({
});
// we grab the file extension and map it to the diff-language
const languageMap = { rs: 'rust', vue: 'html' };
const languageMap = { rs: 'rust', vue: 'html', Dockerfile: 'docker' };
const language = computed(() => {
const pieces = props.comment.path.split('.');
const lang = pieces[pieces.length - 1];
Expand Down

0 comments on commit 1fd0ece

Please sign in to comment.