mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04:00
fixed highlight fence in regard to '=' (showLines) and '!' (wrapLines) (#594)
this was just a simple index problem. The 0. entry of a regex result is the whole string and not the first capture group added e2e tests to fix this in the future cypress does currently not support copy to clipboard in firefox so this part of the test is commented out (for the time being)
This commit is contained in:
parent
23972ffb16
commit
9c38655a92
3 changed files with 101 additions and 3 deletions
|
@ -20,9 +20,9 @@ export class HighlightedCodeReplacer extends ComponentReplacer {
|
|||
let wrapLines = false
|
||||
|
||||
if (extraInfos) {
|
||||
showLineNumbers = extraInfos[0] !== undefined
|
||||
startLineNumberAttribute = extraInfos[1]
|
||||
wrapLines = extraInfos[2] !== undefined
|
||||
showLineNumbers = extraInfos[1]?.startsWith('=') || false
|
||||
startLineNumberAttribute = extraInfos[2]
|
||||
wrapLines = extraInfos[3] === '!'
|
||||
}
|
||||
|
||||
const startLineNumber = startLineNumberAttribute === '+' ? this.lastLineNumber : (parseInt(startLineNumberAttribute) || 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue