-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve formatting of cloned items, add more unit tests
- Loading branch information
1 parent
c205f96
commit 5fdc88b
Showing
7 changed files
with
59 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function addBlockQuote(text) { | ||
return text.replace(/^/gm, '> ') | ||
} | ||
|
||
module.exports = addBlockQuote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
function preventReferences(text) { | ||
// replace "github.com" links with "www.github.com" links, which do not cause references on the original issue due to the "www" (see https://github.com/orgs/community/discussions/23123#discussioncomment-3239240) | ||
return text.replace(/https:\/\/github.com\//gi, 'https://www.github.com/') | ||
} | ||
|
||
module.exports = preventReferences |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const addBlockQuote = require('../lib/addBlockQuote') | ||
|
||
describe('addBlockQuote', () => { | ||
it('adds block quotes to text', () => { | ||
const originalText = 'This is text' | ||
|
||
const blockQuoteText = addBlockQuote(originalText) | ||
expect(blockQuoteText).toEqual(`> ${originalText}`) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const preventReferences = require('../lib/preventReferences') | ||
|
||
describe('preventReferences', () => { | ||
it('updates the url for github', () => { | ||
const originalText = 'This is text with a url: https://github.com/' | ||
|
||
const alteredText = preventReferences(originalText) | ||
expect(alteredText).toEqual(`This is text with a url: https://www.github.com/`) | ||
}) | ||
}) |