eecs485staff / primer-spec

A Jekyll theme for sites with content-heavy pages
https://eecs485staff.github.io/primer-spec/
MIT License
22 stars 12 forks source link

[Enhanced code blocks] Copy button should not omit lines with no text by default #222

Closed seshrs closed 1 year ago

seshrs commented 1 year ago

Fixes #221.

The bug is kind-of embarrassing. When you click the "copy" button, we run a "mapping" function on each line that determines what text should be copied. I forgot that if a line was empty, the mapping function would retun an empty string, which is "falsy" according to the Boolean test. I really should have explicitly checked that the map function's return value is not nullish before excluding it from the copied text. 😅

github-actions[bot] commented 1 year ago

The spec from this PR is available at https://preview.sesh.rs/previews/eecs485staff/primer-spec/222/.

(Available until Fri Dec 09 2022.)