Merge pull request #13652 from IAvecilla/fix-underscore-display
fix(cli): keep snake_case underscores intact in strip markdown mode
This commit is contained in:
@@ -97,4 +97,12 @@ describe('estimateRows', () => {
|
||||
|
||||
expect(estimateRows(md, 40)).toBe(2)
|
||||
})
|
||||
|
||||
it('keeps intraword underscores when sizing snake_case identifiers', () => {
|
||||
const w = 80
|
||||
const snake = 'look at test_case_with_underscores now'
|
||||
const plain = 'look at test case with underscores now'
|
||||
|
||||
expect(estimateRows(snake, w)).toBe(estimateRows(plain, w))
|
||||
})
|
||||
})
|
||||
|
||||
@@ -25,9 +25,9 @@ const renderEstimateLine = (line: string) => {
|
||||
.replace(/\[(.+?)\]\((https?:\/\/[^\s)]+)\)/g, '$1')
|
||||
.replace(/`([^`]+)`/g, '$1')
|
||||
.replace(/\*\*(.+?)\*\*/g, '$1')
|
||||
.replace(/__(.+?)__/g, '$1')
|
||||
.replace(/(?<!\w)__(.+?)__(?!\w)/g, '$1')
|
||||
.replace(/\*(.+?)\*/g, '$1')
|
||||
.replace(/_(.+?)_/g, '$1')
|
||||
.replace(/(?<!\w)_(.+?)_(?!\w)/g, '$1')
|
||||
.replace(/~~(.+?)~~/g, '$1')
|
||||
.replace(/==(.+?)==/g, '$1')
|
||||
.replace(/\[\^([^\]]+)\]/g, '[$1]')
|
||||
|
||||
Reference in New Issue
Block a user