turkle icon indicating copy to clipboard operation
turkle copied to clipboard

Turkle rejects HTML templates that use JavaScript template literals

Open hltcoe-bot opened this issue 4 years ago • 2 comments

Discovered by an undergrad working with paulmac.

Turkle currently assumes that the syntax ${foo} is only used for Turkle template variables. When uploading a CSV file, Turkle (currently) requires that the CSV header include a column name for each of the "template variables" it discovers.

When Mechanical Turk was first deployed, ${foo} was not a valid JavaScript construct. But newer versions of JavaScript (apparently starting with the ES2015 standard) introduced support for Template literals (formerly called Template strings). Template literals are backtick-quoted strings that use the same ${foo} syntax for variable substitution, e.g.:

var foo = 'world';
var x = `hello ${foo}`;

Poster: Craig Harman id: 257

hltcoe-bot avatar Aug 07 '20 15:08 hltcoe-bot

Here are the HTML template and CSV file that exposed the problem:

audio-translation-json.html

json-file.csv

Poster: Craig Harman

hltcoe-bot avatar Aug 07 '20 15:08 hltcoe-bot

mentioned in merge request !216

Poster: Craig Harman

hltcoe-bot avatar Aug 07 '20 15:08 hltcoe-bot