Closed gumaerc closed 2 years ago
Merging #497 (d0148c4) into master (0e394ac) will decrease coverage by
0.13%
. The diff coverage is80.00%
.
@@ Coverage Diff @@
## master #497 +/- ##
==========================================
- Coverage 96.47% 96.33% -0.14%
==========================================
Files 18 18
Lines 2126 2130 +4
==========================================
+ Hits 2051 2052 +1
- Misses 75 78 +3
Impacted Files | Coverage Δ | |
---|---|---|
src/turndown.js | 92.30% <80.00%> (-0.25%) |
:arrow_down: |
src/markdown_generators.js | 97.22% <0.00%> (-1.39%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 0e394ac...d0148c4. Read the comment docs.
Pre-Flight checklist
What are the relevant tickets?
Closes https://github.com/mitodl/ocw-to-hugo/issues/493
What's this PR do?
In https://github.com/mitodl/ocw-to-hugo/pull/418 we added support for parsing multiple choice type quizzes embedded in legacy OCW courses. One of the turndown rules that does this,
multiple_choice_question
, was filtering on:The issue with this is that even if
getElementsByClassName
doesn't find anything, it still returns an object. This means that HTML that shouldn't have been matching that rule was being matched and processed as if it were an multiple choice question. I corrected this by changing it to:A try / catch statement with Winston file logging was also added to the
html2markdown
function so any errors converting html to markdown are logged.How should this be manually tested?
ocw-to-hugo
before and make sure you're set up to download courses from S3private/courses.json
:node . -i private/input -o private/output -c private/courses.json --download --rm