File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ $(() => {
6767
6868 const fullCount = $tgt . val ( ) . trim ( ) . length ;
6969 const count = omitMarkdown ?
70- QPixel . MD . stripMarkdown ( $tgt . val ( ) . trim ( ) , { removeQuotes : true } ) . length :
70+ QPixel . MD . stripMarkdown ( $tgt . val ( ) . trim ( ) , { removeLeadingQuote : true } ) . length :
7171 fullCount ;
7272
7373 $info . toggleClass ( 'hide' , fullCount === count )
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ QPixel.MD = {
77 . replace ( / [ * _ ~ ] + / g, '' )
88 . replace ( / ! ? \[ ( [ ^ \] ] + ) \] (?: \( [ ^ ) ] + \) | \[ [ ^ \] ] + \] ) / g, '$1' ) ;
99
10- if ( options . removeQuotes ) {
10+ if ( options . removeLeadingQuote ?? false ) {
1111 return stripped . replace ( / ^ > .+ ?$ / g, '' ) ;
1212 }
1313
Original file line number Diff line number Diff line change @@ -37,13 +37,19 @@ interface QPixelDOM {
3737 setVisible ?: ( elements : HTMLElement | HTMLElement [ ] , visible : boolean ) => void ;
3838}
3939
40+ interface StripMarkdownOptions {
41+ /**
42+ * Whether to strip away the leading quote ("> content"), if any
43+ * @default false
44+ */
45+ removeLeadingQuote ?: boolean
46+ }
47+
4048interface QPixelMD {
4149 /**
42- * See [strip_markdown](./ app/helpers/application_helper.rb) application helper
50+ * See [strip_markdown](app/helpers/application_helper.rb) application helper
4351 */
44- stripMarkdown ( content : string , options ?: {
45- removeQuotes ?: boolean
46- } ) : string ;
52+ stripMarkdown ( content : string , options ?: StripMarkdownOptions ) : string ;
4753}
4854
4955type QPixelKeyboardState =
You can’t perform that action at this time.
0 commit comments