Skip to content

Commit c6fb736

Browse files
committed
XWIKI-17010: Code viewer doesn't allow to copy blank lines
* Replaced the "empty" lines with a single newline character.
1 parent ba9e83c commit c6fb736

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo

xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/code.vm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ $xwiki.ssfx.use('uicomponents/viewers/code.css', true)##
104104
#end
105105

106106
#set ($lineNumber = $foreach.count)
107+
#if("$el.element" == '')
108+
#set($el.element = $util.getNewline())
109+
#end
107110

108111
#if ($startNewGroup)
109112
</tbody>
@@ -122,6 +125,9 @@ $xwiki.ssfx.use('uicomponents/viewers/code.css', true)##
122125
#set ($lines = $content.split('\n'))
123126
#foreach ($line in $lines)
124127
#set ($lineNumber = $foreach.count)
128+
#if("$line" == '')
129+
#set($line = $util.getNewline())
130+
#end
125131
<tr class="line" id="$lineNumber">
126132
## Even though empty we still need the first 2 TD to make the HTML valid
127133
<td class="author avatar_16 hidden"></td>

0 commit comments

Comments
 (0)