Skip to content

Commit

Permalink
🐛 Fix replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed May 11, 2018
1 parent 829b9d7 commit 2303c08
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions Resources/Private/Fusion/Overwrite.fusion
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
prototype(Neos.Neos:Page) {
[email protected] = Carbon.Hyphen:Shy.DeletePlaceholder
[email protected] = Carbon.Hyphen:Shy.Replace
[email protected] = Carbon.Hyphen:Shy.DeletePlaceholder {
@position = 'end 99999'
}
[email protected] = Carbon.Hyphen:Shy.Replace {
@position = 'end 99999'
}
}
2 changes: 1 addition & 1 deletion Resources/Private/Fusion/Shy/AlwaysReplace.fusion
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
prototype(Carbon.Hyphen:AlwaysReplace) < prototype(Carbon.Hyphen:Shy.Replace) {
prototype(Carbon.Hyphen:Shy.AlwaysReplace) < prototype(Carbon.Hyphen:Shy.Replace) {
@if.environment = true
}
4 changes: 2 additions & 2 deletions Resources/Private/Fusion/Shy/Replace.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ prototype(Carbon.Hyphen:Shy.Replace) < prototype(Neos.Fusion:Value) {
replace = ${Configuration.setting('Carbon.Hyphen.Shy.replace')}
addShy = true
regex = ${'/(?>(\S)' + this.replace + '(\S))' + Configuration.setting('Carbon.Hyphen.Shy.regex') + '/'}
replace = ${this.addShy ? '$1&shy;$2' : '$1$2'}
value = ${String.pregReplace(value, this.regex, this.replace)}
shy = ${this.addShy ? '$1&shy;$2' : '$1$2'}
value = ${String.pregReplace(value, this.regex, this.shy)}

@if {
environment = ${!this.addShy || node.context.live || node.context.currentRenderingMode.preview}
Expand Down

0 comments on commit 2303c08

Please sign in to comment.