File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,4 @@ npm-debug.log
1212. #*
1313
1414/todo
15+ .DS_Store
Original file line number Diff line number Diff line change @@ -161,6 +161,19 @@ export default class DataStore {
161161 return await this . _set ( this . _lineKey_ ( row ) , line ) ;
162162 }
163163
164+ // for backwards compatibility - checks whether the line was struck through
165+ // in the old-style format
166+ public async _isStruckThroughOldFormat ( row : Row ) : Promise < boolean > {
167+ const line = await this . _get < any > ( this . _lineKey_ ( row ) , [ ] ) ;
168+ if ( typeof line !== 'string' && line . length ) {
169+ let char_info = line [ 0 ] ;
170+ if ( char_info . properties && char_info . properties . strikethrough ) {
171+ return true ;
172+ }
173+ }
174+ return false ;
175+ }
176+
164177 public async getParents ( row : Row ) : Promise < Array < Row > > {
165178 return await this . _get ( this . _parentsKey_ ( row ) , [ ] , decodeParents ) ;
166179 }
Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ registerPlugin<void>(
3333 } ) ;
3434
3535 async function isStruckThrough ( session : Session , row : Row ) {
36+ // for backwards compatibility
37+ const isStruckThroughOldStyle = await session . document . store . _isStruckThroughOldFormat ( row ) ;
38+ if ( isStruckThroughOldStyle ) { return true ; }
39+
3640 const text = await session . document . getText ( row ) ;
3741 return ( text . slice ( 0 , 2 ) === '~~' ) && ( text . slice ( - 2 ) === '~~' ) ;
3842 }
You can’t perform that action at this time.
0 commit comments