File tree Expand file tree Collapse file tree 2 files changed +2
-11
lines changed
src/components/content/PrismCode Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ function isDiffCode(code: string): boolean {
3333 const lines = code . split ( '\n' ) ;
3434
3535 // Define patterns to check for diff characteristics
36- const additionPattern = / ^ \+ / ; // Lines starting with '+' (allow indent)
37- const deletionPattern = / ^ - + / ; // Lines starting with '-' (allow indent)
36+ const additionPattern = / ^ \+ / ; // Lines starting with '+'
37+ const deletionPattern = / ^ - + / ; // Lines starting with '-'
3838 const headerPattern = / ^ ( d i f f - - g i t | - - - | \+ \+ \+ ) / ; // Diff headers
3939
4040 // Check each line for diff-specific patterns
Original file line number Diff line number Diff line change @@ -219,13 +219,4 @@ RendererPrism.languages.sql = {
219219 } ) ;
220220} ) ( RendererPrism ) ;
221221
222- // Ensure all diff-* languages are registered after grammars load
223- const diffLanguagePattern = / ^ d i f f - ( .+ ) $ / ;
224- Object . keys ( Prism . languages ) . forEach ( ( lang ) => {
225- const diffLang = `diff-${ lang } ` ;
226- if ( ! Prism . languages [ diffLang ] && ! diffLanguagePattern . test ( lang ) ) {
227- Prism . languages [ diffLang ] = Prism . languages . diff ;
228- }
229- } ) ;
230-
231222export { RendererPrism as Prism } ;
You can’t perform that action at this time.
0 commit comments