react-diff-view icon indicating copy to clipboard operation
react-diff-view copied to clipboard

hightlight=true,css in js 解析问题

Open lunalusy opened this issue 6 years ago • 2 comments

const options = { highlight: true, oldSource, language: codeType, refractor, enhancers: [markEdits(hunksWithSourceExpanded, { type: 'line' })], }; const tokenizedResult = tokenize(hunksWithSourceExpanded, options); 这样的写法,使用styled-component定义的样式解析出来不对 ${hiDPI(1.5)} { CSS_1   } CSS_2 { CSS_3 }   CSS_4 { CSS_5 } CSS_6 { CSS_7

highlight=false,解析就是正确的,但是没有高亮

${hiDPI(1.5)} {

${content(.75, 1.5)} ${hiDPI(2)} { ${content(.5, 2)} ${hiDPI(2.75)} {   ${content(.36363636, 2.75)}   ${hiDPI(3)} { ${content(.33333333, 3)}   }

请问是我哪里写法有问题嘛,还有,语法高亮是需要手动引入语法高亮样式库嘛? 发现手动import 'prismjs/themes/prism-coy.css';,hightlight=true是有语法高亮的

const options = { highlight: true, oldSource, language: codeType, // refractor, enhancers: [markEdits(hunksWithSourceExpanded, { type: 'line' })], }; 如果不引入refractor,会报 Cannot read property 'highlight' of undefined的错

lunalusy avatar Jun 09 '20 13:06 lunalusy

@dancerphil 这个事情是不是refractor的BUG?

otakustay avatar Jun 10 '20 09:06 otakustay

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 28 '20 07:07 stale[bot]