Simon-Initiative / course-digest

Tool to produce a summary or digest of OLI course package contents
MIT License
2 stars 0 forks source link

[BUGFIX] [MER-3226] map code language values to torus versions for syntax coloring #248

Closed andersweinstein closed 4 months ago

andersweinstein commented 4 months ago

Migration was not getting syntax highlighting on python codeblocks. Was passing through the legacy language attribute value "python" unchanged. It seems torus code language ids are the "pretty" capitalized strings displayed in the language choice dropdown menu and lookup is case-sensitive. So in this case language value must be "Python" to work. This converts language values appropriately to get syntax highlighting.

Legacy DTD has only a small number of syntax values defined, so don't have to worry about mapping "sql" => "SQL" or "typescript" => "TypeScript", but do have to map "cpp" => "C++".