Skip to content

Commit

Permalink
Replace double quotes with single quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
start committed Aug 27, 2019
1 parent 32dec86 commit b264025
Show file tree
Hide file tree
Showing 90 changed files with 825 additions and 825 deletions.
2 changes: 1 addition & 1 deletion src/Implementation/NormalizedSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ function sanitizeVariations(variations: Settings.Parsing.Keyword | undefined): N

const normalizedVariations =
// First of all, if the user provided a string, let's convert it to an array.
((typeof variations === "string") ? [variations] : variations)
((typeof variations === 'string') ? [variations] : variations)
// Let's ignore any term variations that are null or empty.
.filter(variation => !!variation)
// Let's trim the remaining term variations...
Expand Down
30 changes: 15 additions & 15 deletions src/Test/FiddlingWithSyntaxTree/Document.create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import { cast } from '../Helpers'

const NOT_USED = cast<string>(null)

context("The `Document.create` method is automatically used during the normal parsing process. It returns a document object with:", () => {
specify("A table of contents", () => {
context('The `Document.create` method is automatically used during the normal parsing process. It returns a document object with:', () => {
specify('A table of contents', () => {
const documentChildren = [
new Up.Heading([new Up.Text('I enjoy apples')], { level: 1, titleMarkup: NOT_USED }),
new Up.NumberedList([
new Up.NumberedList.Item([
new Up.Heading([new Up.Text("They're cheap")], { level: 2, titleMarkup: NOT_USED }),
new Up.Paragraph([new Up.Text("Very cheap.")])
new Up.Paragraph([new Up.Text('Very cheap.')])
]),
new Up.NumberedList.Item([
new Up.Heading([new Up.Text("They're delicious")], { level: 2, titleMarkup: NOT_USED }),
new Up.Paragraph([new Up.Text("Very delicious.")])
new Up.Paragraph([new Up.Text('Very delicious.')])
])
])
]
Expand Down Expand Up @@ -51,17 +51,17 @@ context("The `Document.create` method is automatically used during the normal pa
new Up.NumberedList([
new Up.NumberedList.Item([
cheapHeading,
new Up.Paragraph([new Up.Text("Very cheap.")])
new Up.Paragraph([new Up.Text('Very cheap.')])
]),
new Up.NumberedList.Item([
deliciousHeading,
new Up.Paragraph([new Up.Text("Very delicious.")])
new Up.Paragraph([new Up.Text('Very delicious.')])
])
])
], new Up.Document.TableOfContents([enjoyHeading, cheapHeading, deliciousHeading])))
})

specify("Section links matched with the appropriate table of contents entries", () => {
specify('Section links matched with the appropriate table of contents entries', () => {
const documentChildren = [
new Up.Heading([new Up.Text('I drink soda')], { level: 1, titleMarkup: 'I drink soda' }),
new Up.Paragraph([
Expand Down Expand Up @@ -107,17 +107,17 @@ context("The `Document.create` method is automatically used during the normal pa
], new Up.Document.TableOfContents([sodaHeading, neverLieHeading])))
})

specify("Any footnotes assigned their reference numbers (mutating them) and placed in footnote blocks (mutating any outline nodes the blocks are placed inside)", () => {
specify('Any footnotes assigned their reference numbers (mutating them) and placed in footnote blocks (mutating any outline nodes the blocks are placed inside)', () => {
const documentChildren = [
new Up.Paragraph([
new Up.Text("I don't eat cereal."),
new Up.Footnote([new Up.Text('Well, I do, but I pretend not to.')]),
new Up.Text(" Never have.")
new Up.Text(' Never have.')
]),
new Up.RevealableBlock([
new Up.Paragraph([
new Up.Text("This ruins the movie."),
new Up.Footnote([new Up.Text("And this is a fun fact.")])
new Up.Text('This ruins the movie.'),
new Up.Footnote([new Up.Text('And this is a fun fact.')])
])
])
]
Expand All @@ -129,22 +129,22 @@ context("The `Document.create` method is automatically used during the normal pa
new Up.Footnote([new Up.Text('Well, I do, but I pretend not to.')], { referenceNumber: 1 })

const movieFootnote =
new Up.Footnote([new Up.Text("And this is a fun fact.")], { referenceNumber: 2 })
new Up.Footnote([new Up.Text('And this is a fun fact.')], { referenceNumber: 2 })

expect(document).to.deep.equal(
new Up.Document([
new Up.Paragraph([
new Up.Text("I don't eat cereal."),
cerealFootnote,
new Up.Text(" Never have.")
new Up.Text(' Never have.')
]),
new Up.FootnoteBlock([
cerealFootnote
]),
new Up.RevealableBlock([
new Up.Paragraph([
new Up.Text("This ruins the movie."),
new Up.Footnote([new Up.Text("And this is a fun fact.")], { referenceNumber: 2 })
new Up.Text('This ruins the movie.'),
new Up.Footnote([new Up.Text('And this is a fun fact.')], { referenceNumber: 2 })
]),
new Up.FootnoteBlock([
movieFootnote
Expand Down
16 changes: 8 additions & 8 deletions src/Test/Html/Escaping/AttributeValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { cast } from '../../Helpers'


context('Within any attribute value, all instances of " and & are escaped. Specifically, within the', () => {
specify("src attribute of links", () => {
specify('src attribute of links', () => {
const document = new Up.Document([
new Up.Paragraph([
new Up.Link([], 'https://example.com/?x&y&z="hi"')
Expand All @@ -15,7 +15,7 @@ context('Within any attribute value, all instances of " and & are escaped. Speci
'<p><a href="https://example.com/?x&amp;y&amp;z=&quot;hi&quot;"></a></p>')
})

specify("src attribute of audio elements (and of their fallback links)", () => {
specify('src attribute of audio elements (and of their fallback links)', () => {
const document = new Up.Document([
new Up.Audio('Weird', 'https://example.com/?x&y&z="hi"')
])
Expand All @@ -26,7 +26,7 @@ context('Within any attribute value, all instances of " and & are escaped. Speci
+ '</audio>')
})

specify("src attribute of videos (and of their fallback links)", () => {
specify('src attribute of videos (and of their fallback links)', () => {
const document = new Up.Document([
new Up.Video('Weird', 'https://example.com/?x&y&z="hi"')
])
Expand All @@ -37,7 +37,7 @@ context('Within any attribute value, all instances of " and & are escaped. Speci
+ '</video>')
})

specify("src attribute of images", () => {
specify('src attribute of images', () => {
const document = new Up.Document([
new Up.Image('Weird', 'https://example.com/?x&y&z="hi"')
])
Expand All @@ -46,7 +46,7 @@ context('Within any attribute value, all instances of " and & are escaped. Speci
'<img alt="Weird" src="https://example.com/?x&amp;y&amp;z=&quot;hi&quot;" title="Weird">')
})

specify("title attribute of audio elements", () => {
specify('title attribute of audio elements', () => {
const document = new Up.Document([
new Up.Audio('John said, "1 and 2 > 0. I can\'t believe it."', 'https://example.com/m')
])
Expand All @@ -57,7 +57,7 @@ context('Within any attribute value, all instances of " and & are escaped. Speci
+ '</audio>')
})

specify("title attribute of videos", () => {
specify('title attribute of videos', () => {
const document = new Up.Document([
new Up.Video('John said, "1 and 2 > 0. I can\'t believe it."', 'https://example.com/m')
])
Expand All @@ -68,7 +68,7 @@ context('Within any attribute value, all instances of " and & are escaped. Speci
+ '</video>')
})

specify("alt and title attributes of images", () => {
specify('alt and title attributes of images', () => {
const document = new Up.Document([
new Up.Image('John said, "1 and 2 > 0. I can\'t believe it."', 'https://example.com/m')
])
Expand Down Expand Up @@ -211,7 +211,7 @@ context('Within any attribute value, all instances of " and & are escaped. Speci


describe("Within a link's href attribute, <, ', and >", () => {
it("are not escaped", () => {
it('are not escaped', () => {
const document = new Up.Document([
new Up.Paragraph([
new Up.Link([], "https://example.com/?z='<span>'")
Expand Down
12 changes: 6 additions & 6 deletions src/Test/Html/FromMarkup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai'
import * as Up from '../../Main'


context("You can render HTML directly from markup.", () => {
context('You can render HTML directly from markup.', () => {
context('The parseAndRender method', () => {
specify('can be used with parsing settings', () => {
const markup = `
Expand Down Expand Up @@ -286,7 +286,7 @@ SPOILER

context('The parseAndRenderInline method', () => {
specify('can be used with parsing settings', () => {
const markup = `After beating the Elite Four, [LOOK AWAY: Blue steals a Red Delicious from Red.]`
const markup = 'After beating the Elite Four, [LOOK AWAY: Blue steals a Red Delicious from Red.]'

const html = Up.parseAndRenderInline(markup, {
parsing: {
Expand All @@ -306,7 +306,7 @@ SPOILER
})

specify('can be used with rendering settings', () => {
const markup = `After beating the Elite Four, [SPOILER: Blue steals a Red Delicious from Red.]`
const markup = 'After beating the Elite Four, [SPOILER: Blue steals a Red Delicious from Red.]'

const html = Up.parseAndRenderInline(markup, {
rendering: {
Expand All @@ -326,7 +326,7 @@ SPOILER
})

specify('can be used with both parsing and rendering settings together', () => {
const markup = `After beating the Elite Four, [LOOK AWAY: Blue steals a Red Delicious from Red.]`
const markup = 'After beating the Elite Four, [LOOK AWAY: Blue steals a Red Delicious from Red.]'

const html = Up.parseAndRenderInline(markup, {
parsing: {
Expand All @@ -349,7 +349,7 @@ SPOILER
})

specify('can be used without settings', () => {
const markup = `After beating the Elite Four, [SPOILER: Blue steals a Red Delicious from Red.]`
const markup = 'After beating the Elite Four, [SPOILER: Blue steals a Red Delicious from Red.]'

expect(Up.parseAndRenderInline(markup)).to.equal(
'After beating the Elite Four, '
Expand All @@ -363,7 +363,7 @@ SPOILER
})

specify('can be used with empty settings', () => {
const markup = `After beating the Elite Four, [SPOILER: Blue steals a Red Delicious from Red.]`
const markup = 'After beating the Elite Four, [SPOILER: Blue steals a Red Delicious from Red.]'

const withoutSettings = Up.parseAndRenderInline(markup)
const withEmptySettings = Up.parseAndRenderInline(markup, {})
Expand Down
6 changes: 3 additions & 3 deletions src/Test/Html/Links/NestedLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ context('A link within a table of contents entry does not produce an <a> element


context("When a link is nested deeply within another link, it doesn't produce an <a> element. This is true for:", () => {
specify("A footnote nested deeply within a link", () => {
specify('A footnote nested deeply within a link', () => {
const document = new Up.Document([
new Up.Paragraph([
new Up.Link([
Expand All @@ -107,7 +107,7 @@ context("When a link is nested deeply within another link, it doesn't produce an
+ '</p>')
})

specify("A link nested deeply within another a link", () => {
specify('A link nested deeply within another a link', () => {
const document = new Up.Document([
new Up.Paragraph([
new Up.Link([
Expand Down Expand Up @@ -208,7 +208,7 @@ context('When severeal links are nested within each other', () => {


context('When a link contains 2 or more inner links', () => {
specify("neither inner link produces an <a> element", () => {
specify('neither inner link produces an <a> element', () => {
const document = new Up.Document([
new Up.Paragraph([
new Up.Link([
Expand Down
8 changes: 4 additions & 4 deletions src/Test/Html/SequentialIdsForRevealableElements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { expect } from 'chai'
import * as Up from '../../Main'


describe("Both inline revealables and revealable blocks", () => {
it("have sequential IDs", () => {
describe('Both inline revealables and revealable blocks', () => {
it('have sequential IDs', () => {
const node =
new Up.Document([
new Up.RevealableBlock([
Expand Down Expand Up @@ -84,7 +84,7 @@ describe("Both inline revealables and revealable blocks", () => {


describe("The ID of an inline revealable's checkbox (on both the checkbox and the label)", () => {
it("is reset each time a new document is written", () => {
it('is reset each time a new document is written', () => {
const up = new Up.Up()

const node =
Expand Down Expand Up @@ -118,7 +118,7 @@ describe("The ID of an inline revealable's checkbox (on both the checkbox and th


describe("The ID of a revealable block's checkbox (on both the checkbox and the label)", () => {
it("is reset each time a new document is written", () => {
it('is reset each time a new document is written', () => {
const up = new Up.Up()

const node =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ describe('The "baseForUrlsStartingWithFragmentIdentifier" setting', () => {
const document = new Up.Document([
new Up.FootnoteBlock([
new Up.Footnote([
new Up.Text("Arwings")
new Up.Text('Arwings')
], { referenceNumber: 2 }),
new Up.Footnote([
new Up.Text("Killer Bees")
new Up.Text('Killer Bees')
], { referenceNumber: 3 })
])
])
Expand Down
4 changes: 2 additions & 2 deletions src/Test/Html/Settings/Changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function itCanBeProvidedMultipleWaysWithTheSameResult(
Up.renderWithTableOfContents(document)


describe("when provided to the default renderWithTableOfContents function", () => {
it("does not alter subsequent calls to the default method", () => {
describe('when provided to the default renderWithTableOfContents function', () => {
it('does not alter subsequent calls to the default method', () => {
// Let's make sure the changed settings would actually change the HTML
expect(Up.renderWithTableOfContents(document, change)).to.not.equal(htmlFromDefaultSettings)

Expand Down
6 changes: 3 additions & 3 deletions src/Test/Html/Settings/Footnote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ describe("A footnote's ID", () => {
const node = new Up.Document([
new Up.FootnoteBlock([
new Up.Footnote([
new Up.Text("Arwings")
new Up.Text('Arwings')
], { referenceNumber: 2 }),
new Up.Footnote([
new Up.Text("Killer Bees")
new Up.Text('Killer Bees')
], { referenceNumber: 3 })
])
])
Expand All @@ -34,7 +34,7 @@ describe("A footnote's ID", () => {
})


describe("The ID of the footnote referenced by a footnote reference", () => {
describe('The ID of the footnote referenced by a footnote reference', () => {
it('uses the provided term for "footnote"', () => {
const up = new Up.Up({
rendering: {
Expand Down
6 changes: 3 additions & 3 deletions src/Test/Html/Settings/FootnoteReference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("A footnote reference's ID", () => {
})


describe("The ID of the footnote reference referencing the footnote", () => {
describe('The ID of the footnote reference referencing the footnote', () => {
it('uses the provided term for "footnote reference"', () => {
const up = new Up.Up({
rendering: {
Expand All @@ -37,10 +37,10 @@ describe("The ID of the footnote reference referencing the footnote", () => {
const document = new Up.Document([
new Up.FootnoteBlock([
new Up.Footnote([
new Up.Text("Arwings")
new Up.Text('Arwings')
], { referenceNumber: 2 }),
new Up.Footnote([
new Up.Text("Killer Bees")
new Up.Text('Killer Bees')
], { referenceNumber: 3 })
])
])
Expand Down
4 changes: 2 additions & 2 deletions src/Test/Html/Settings/Hide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as Up from '../../../Main'


context('The "hide" term is used on the hide button of revealable content:', () => {
specify("Inline revealables", () => {
specify('Inline revealables', () => {
const up = new Up.Up({
rendering: {
terms: { hide: 'collapse' }
Expand Down Expand Up @@ -32,7 +32,7 @@ context('The "hide" term is used on the hide button of revealable content:', ()
expect(up.render(node)).to.equal(html)
})

specify("Revealable blocks", () => {
specify('Revealable blocks', () => {
const up = new Up.Up({
rendering: {
terms: { hide: 'minimize' }
Expand Down
Loading

0 comments on commit b264025

Please sign in to comment.