11import { describe } from 'vitest' ;
2- import { forge } from './index.js' ;
2+ import { engrave , forge } from './index.js' ;
33
44// `deny` disallow features, either:
55// - outright, like indented code block and setext headings
@@ -767,6 +767,16 @@ describe('libretto', ({ concurrent: it }) => {
767767 '<figure>\n<img src="img.png" alt="alt" />\n<figcaption>annotated <em>title</em> for caption</figcaption>\n</figure>' ,
768768 ] ,
769769
770+ 'quotes#double/1' : [ '"hello"' , '<p>“hello”</p>' ] ,
771+ 'quotes#double/2' : [ '"a *b* c"' , '<p>“a <em>b</em> c”</p>' ] ,
772+ 'quotes#single/1' : [ "'hello'" , '<p>‘hello’</p>' ] ,
773+ 'quotes#single/2' : [ "'a 'b' c'" , '<p>‘a ‘b’ c’</p>' ] ,
774+ 'quotes#mixed/1' : [ `"a 'b' c"` , '<p>“a ‘b’ c”</p>' ] ,
775+ 'quotes#mixed/2' : [ `'a "b" c'` , '<p>‘a “b” c’</p>' ] ,
776+ 'quotes#mixed/3' : [ `'a "b' c"` , '<p>‘a “b’ c”</p>' ] ,
777+ 'quotes#mixed/4' : [ `'"hello"'` , '<p>‘“hello”’</p>' ] ,
778+ 'quotes#mixed/5' : [ `"'hello'"` , '<p>“‘hello’”</p>' ] ,
779+
770780 'strike#single' : [ '~strike~' , '<p>~strike~</p>' ] ,
771781 'strike#normal' : [ '~~strike~~' , '<p><del>strike</del></p>' ] ,
772782 'strike#code/1' : [ '~~`a~~`' , '<p>~~<code>a~~</code></p>' ] ,
@@ -796,7 +806,7 @@ describe('libretto', ({ concurrent: it }) => {
796806 'strike#newline/1' : [ '~~a\n~~' , '<p>~~a\n~~</p>' ] ,
797807 'strike#newline/2' : [ '~~\na~~' , '<p>~~\na~~</p>' ] ,
798808 'strike#newline/3' : [ '~~\na\n~~' , '<p>~~\na\n~~</p>' ] ,
799- 'strike#between/1' : [ 'a~~"b"~~' , '<p>a~~"b" ~~</p>' ] ,
809+ 'strike#between/1' : [ 'a~~"b"~~' , '<p>a~~“b” ~~</p>' ] ,
800810 'strike#between/2|todo' : [ '-~~~~;~~~~~~' , '<p>-<del><del>;</del></del>~~</p>' ] ,
801811
802812 'table#normal' : [
@@ -809,7 +819,6 @@ describe('libretto', ({ concurrent: it }) => {
809819 ] ,
810820 } ;
811821
812- const mark = forge ( ) ;
813822 for ( const test in suite ) {
814823 const [ input , output ] = suite [ test ] ;
815824 const [ , ...props ] = test . split ( '|' ) ;
@@ -820,7 +829,7 @@ describe('libretto', ({ concurrent: it }) => {
820829 todo : props . includes ( 'todo' ) ,
821830 } ;
822831 it ( test , options , ( { expect } ) => {
823- expect ( mark ( input ) . html ( ) ) . toBe ( output ) ;
832+ expect ( engrave ( input ) . html ( ) ) . toBe ( output ) ;
824833 } ) ;
825834 }
826835} ) ;
0 commit comments