bare-script 3.8.5 → 3.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -127,7 +127,7 @@ function dataTableMarkdown(data, model):
127
127
  value = objectGet(row, field)
128
128
  valueType = systemType(value)
129
129
  if valueType == 'string':
130
- valueFormat = value
130
+ valueFormat = stringTrim(value)
131
131
  elif valueType == 'number':
132
132
  valueFormat = numberToFixed(value, precisionNumber, precisionTrim)
133
133
  elif valueType == 'datetime':
@@ -135,6 +135,12 @@ function dataTableMarkdown(data, model):
135
135
  else:
136
136
  valueFormat = stringNew(value)
137
137
  endif
138
+
139
+ # Eliminate value string newlines
140
+ valueFormat = regexReplace(dataTableMarkdownRegexMultipleNewline, valueFormat, '<br><br>')
141
+ valueFormat = regexReplace(dataTableMarkdownRegexSingleNewline, valueFormat, ' ')
142
+
143
+ # Set the field value string
138
144
  objectSet(rowFormat, field, valueFormat)
139
145
 
140
146
  # Update the field width
@@ -190,6 +196,11 @@ function dataTableMarkdown(data, model):
190
196
  endfunction
191
197
 
192
198
 
199
+ # Field value newline replacement regular expressions
200
+ dataTableMarkdownRegexMultipleNewline = regexNew('\r?\n(?:\r?\n)+')
201
+ dataTableMarkdownRegexSingleNewline = regexNew('\r?\n')
202
+
203
+
193
204
  # Helper to generate the Markdown field text
194
205
  function dataTableMarkdownField(value, width, align, fill):
195
206
  spaces = width - stringLength(value)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "bare-script",
4
- "version": "3.8.5",
4
+ "version": "3.8.6",
5
5
  "description": "BareScript; a lightweight scripting and expression language",
6
6
  "keywords": [
7
7
  "expression",