Skip to content

Commit 95f971d

Browse files
committed
When processing selectors of type TYPE, don't only look for
`"<&TYPE>"` but also `execparams.TYPE`. This allows for tests that use the `execparams` pytext fixture to also be rendered properly when included verbatim.
1 parent 2c79f32 commit 95f971d

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

docs/_static/extras.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,28 @@ function detectAll(selectorType) {
5959
// Similarly, if "D" is selected in the second selector, we only want to change
6060
// simple_value_2. However, if either "B" or "C" are selected in either selector,
6161
// we want to change both.
62-
62+
63+
console.log("type:" + selectorType);
6364
$("p." + selectorType + "-selector").addClass(selectorType + "-item");
65+
var prevSpans = [];
6466
$("span").each(function() {
65-
if ($(this).text() == '"<&' + selectorType + '>"') {
67+
var text = $(this).text();
68+
// look for both "<&<type>>" and execparams.<type> to align with test cases
69+
70+
if (text == '"<&' + selectorType + '>"') {
6671
$(this).addClass(selectorType + "-item").addClass("psij-selector-value");
6772
}
73+
if (text == "executor" && prevSpans.length == 2
74+
&& prevSpans[0].text() == "execparams" && prevSpans[1].text() == '.') {
75+
// remove <span>execparams</span> and <span>.</span>
76+
prevSpans[0].remove();
77+
prevSpans[1].remove();
78+
$(this).addClass(selectorType + "-item").addClass("psij-selector-value");
79+
}
80+
prevSpans.push($(this));
81+
if (prevSpans.length > 2) {
82+
prevSpans.shift();
83+
}
6884
});
6985
}
7086

0 commit comments

Comments
 (0)