File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,11 @@ const findSefariaRef = (node: Node | null): FindSefariaRefReturnType => {
44
44
let highlightId ;
45
45
while ( node ?. parentElement ) {
46
46
const $parentElement = $ ( node . parentElement ) ;
47
- isEnglish = isEnglish || $parentElement . hasClass ( "english" ) ;
47
+ console . log ( $parentElement ) ;
48
+ isEnglish = (
49
+ isEnglish
50
+ || $parentElement . hasClass ( "english" )
51
+ || $parentElement . hasClass ( "english-ref-text" ) ) ;
48
52
const isTranslationOfSourceText = $parentElement . hasClass ( "translation" ) ;
49
53
const ref = $parentElement . attr ( "sefaria-ref" ) ;
50
54
highlightId ||= $parentElement . attr ( "highlight-id" ) ;
@@ -142,6 +146,7 @@ class SelectionState {
142
146
const selection = document . getSelection ( ) ! ;
143
147
this . selectedText = selection . toString ( ) . trim ( ) ?? "" ;
144
148
const { isEnglish, hebrew, translation} = this . sefariaRef ;
149
+ console . log ( isEnglish , translation , hebrew ) ;
145
150
const entireNodeAndText = isEnglish ? translation : hebrew ;
146
151
if ( entireNodeAndText === undefined ) {
147
152
throw new Error ( `Text is undefined: ${ JSON . stringify ( this . sefariaRef ) } ` ) ;
You can’t perform that action at this time.
0 commit comments