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

Commit 8358126

Browse files
committed
✨ Adding sytnax highlighting for horizontal parsons
1 parent cfddfcd commit 8358126

File tree

6 files changed

+5009
-10
lines changed

6 files changed

+5009
-10
lines changed

runestone/hparsons/css/hljs-xcode.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runestone/hparsons/hparsons.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def setup(app):
4646
TEMPLATE_END = """
4747
</div>
4848
<div class='hparsons'></div>
49-
<textarea data-lang="%(language)s"
49+
<textarea
50+
%(language)s
5051
%(optional)s
5152
%(dburl)s
5253
%(reuse)s
@@ -131,6 +132,11 @@ def run(self):
131132

132133
env = self.state.document.settings.env
133134

135+
if "language" in self.options:
136+
self.options["language"] = "data-language='{}'".format(self.options["language"])
137+
else:
138+
self.options["language"] = ""
139+
134140
if "reuse" in self.options:
135141
self.options['reuse'] = ' data-reuse="true"'
136142
else:
@@ -161,10 +167,6 @@ def run(self):
161167

162168
self.options["initialsetting"] = source
163169

164-
# TODO: change this
165-
if "language" not in self.options:
166-
self.options["language"] = "python"
167-
168170
# SQL Options
169171
if "dburl" in self.options:
170172
self.options["dburl"] = "data-dburl='{}'".format(self.options["dburl"])

runestone/hparsons/js/BlockFeedback.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default class BlockFeedback extends HParsonsFeedback {
2424
}
2525
this.solution = solutionBlocks;
2626
this.grader.solution = solutionBlocks;
27-
this.answerArea = this.hparsons.hparsonsInput.shadowRoot.querySelector('.drop-area');
27+
this.answerArea = this.hparsons.hparsonsInput.querySelector('.drop-area');
2828
}
2929

3030
// Called when check button clicked (block-based Feedback)

0 commit comments

Comments
 (0)