Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 2267a1c

Browse files
committed
Allow spaces in column titles
1 parent f4d93bd commit 2267a1c

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

runestone/spreadsheet/js/spreadsheet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class SpreadSheet extends RunestoneBase {
3939
if (this.coltitles) {
4040
for (let i in this.coltitles) {
4141
if (opts.columns[i]) {
42-
opts.columns[i].title = this.coltitles[i];
42+
opts.columns[i].title = unescape(this.coltitles[i]);
4343
} else {
4444
opts.columns.push({title:this.coltitles[i]});
4545
}

runestone/spreadsheet/spreadsheet.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import io
2020
import os
2121
import re
22+
import urllib.parse
2223
from docutils import nodes
2324
from docutils.parsers.rst import directives
2425
from runestone.common.runestonedirective import (
@@ -124,7 +125,7 @@ def run(self):
124125
self.options["coltitles"] = ""
125126
else:
126127
self.options["coltitles"] = "data-coltitles=[{}]".format(
127-
",".join([x.strip() for x in self.options["coltitles"].split(",")])
128+
",".join([urllib.parse.quote(x.strip(),safe="'\"") for x in self.options["coltitles"].split(",")])
128129
)
129130

130131
if "mindimensions" not in self.options:

runestone/spreadsheet/test/_sources/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Cells in the spreadsheet that are graded are initially colored light blue. When
4040

4141
.. spreadsheet:: ss3
4242
:colwidths: 200,200
43+
:coltitles: 'my formula', 'result'
4344

4445
"=CONCATENATE(""abc"", ""xyz"")","=CONCATENATE(""abc"", ""xyz"")"
4546
'=1+1, 2

0 commit comments

Comments
 (0)