Skip to content

Commit dd2ddcc

Browse files
committed
Workaround for Markdeep bug in code listings
It turns out that a pattern like '<a b>' inside a code listing fools Markdeep into thinking it has an embedded HTML tag or something, and such a string will be expanded to '<a b="">'. Thus the line *bptr = static_cast<unsigned char>(*fptr * 256.0); gets transformed into *bptr = static_cast<unsigned char="">(*fptr * 256.0); when rendered. I've sent email to Morgan about this bug, but in the meantime, the best workaround I could come up with that can be safely copy-pasted and compiled is *bptr = static_cast< unsigned char >(*fptr * 256.0); That is, inserting spaces in the angle brackets. Somewhat ugly, but thankfully this is in rtw_stb_image.h, which the reader just uses as a gift instead of really working with. Issue #1463 tracks the work to undo this once it's fixed in Markdeep.
1 parent afc6705 commit dd2ddcc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

books/RayTracingTheNextWeek.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,7 @@
18131813
auto *bptr = bdata;
18141814
auto *fptr = fdata;
18151815
for (auto i=0; i < total_bytes; i++, fptr++, bptr++)
1816-
*bptr = static_cast<unsigned char>(*fptr * 256.0);
1816+
*bptr = static_cast< unsigned char >(*fptr * 256.0);
18171817
}
18181818
};
18191819

0 commit comments

Comments
 (0)