File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
packages/site-kit/src/lib/markdown Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -42,14 +42,24 @@ export const slugify = (str: string) => {
4242 . replace ( / - $ / , '' ) ;
4343} ;
4444
45+ /**
46+ * Replace dumb quotes with smart quotes. This isn't a perfect algorithm — it
47+ * wouldn't correctly handle `That '70s show` or `My country 'tis of thee` but
48+ * a) it's very unlikely they'll occur in our docs, and
49+ * b) they can be dealt with manually
50+ */
4551export function smart_quotes (
4652 str : string ,
47- { first = true , html = false } : { first ?: boolean ; html ?: boolean } = { }
53+ {
54+ first = true ,
55+ html = false
56+ } : {
57+ /** True if the string is the entire sentence or false if it's a substring. @default true */
58+ first ?: boolean ;
59+ /** True if the string has HTML entities. @default false */
60+ html ?: boolean ;
61+ } = { }
4862) {
49- // replace dumb quotes with smart quotes. This isn't a perfect algorithm — it
50- // wouldn't correctly handle `That '70s show` or `My country 'tis of thee`
51- // but a) it's very unlikely they'll occur in our docs, and
52- // b) they can be dealt with manually
5363 let open_quote = false ;
5464 let res = '' ;
5565 const len = str . length ;
You can’t perform that action at this time.
0 commit comments