Skip to content

Commit 40c5c92

Browse files
whydoubthollasch
authored andcommitted
Fix broken highlighting on some code listings
Resolves #1600
1 parent cac1b1a commit 40c5c92

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Change Log / Ray Tracing in One Weekend
1313

1414
### In One Weekend
1515
- Fix -- Fixed usage of the term "unit cube" for a cube of diameter two (#1555)
16+
- Fix -- Fixed broken highlighting on some code listings (#1600)
1617

1718
### The Next Week
1819

books/RayTracingInOneWeekend.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@
16371637
// Common Headers
16381638

16391639
#include "color.h"
1640-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
1640+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
16411641
#include "interval.h"
16421642
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
16431643
#include "ray.h"
@@ -1995,7 +1995,7 @@
19951995

19961996
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
19971997
#include <cmath>
1998-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
1998+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
19991999
#include <cstdlib>
20002000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
20012001
#include <iostream>
@@ -2010,7 +2010,7 @@
20102010
}
20112011

20122012

2013-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
2013+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
20142014
inline double random_double() {
20152015
// Returns a random real in [0,1).
20162016
return std::rand() / (RAND_MAX + 1.0);
@@ -2274,7 +2274,7 @@
22742274
}
22752275

22762276

2277-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
2277+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
22782278
static vec3 random() {
22792279
return vec3(random_double(), random_double(), random_double());
22802280
}
@@ -2317,7 +2317,7 @@
23172317
}
23182318

23192319

2320-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
2320+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
23212321
inline vec3 random_in_unit_sphere() {
23222322
while (true) {
23232323
auto p = vec3::random(-1,1);
@@ -2349,7 +2349,7 @@
23492349
}
23502350

23512351

2352-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
2352+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
23532353
inline vec3 random_unit_vector() {
23542354
return unit_vector(random_in_unit_sphere());
23552355
}
@@ -2380,7 +2380,7 @@
23802380
}
23812381

23822382

2383-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
2383+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
23842384
inline vec3 random_on_hemisphere(const vec3& normal) {
23852385
vec3 on_unit_sphere = random_unit_vector();
23862386
if (dot(on_unit_sphere, normal) > 0.0) // In the same hemisphere as the normal
@@ -2905,7 +2905,7 @@
29052905
};
29062906

29072907

2908-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
2908+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
29092909
class lambertian : public material {
29102910
public:
29112911
lambertian(const color& albedo) : albedo(albedo) {}
@@ -2947,7 +2947,7 @@
29472947
}
29482948

29492949

2950-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
2950+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
29512951
bool near_zero() const {
29522952
// Return true if the vector is close to zero in all dimensions.
29532953
auto s = 1e-8;
@@ -3014,7 +3014,7 @@
30143014
}
30153015

30163016

3017-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
3017+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
30183018
inline vec3 reflect(const vec3& v, const vec3& n) {
30193019
return v - 2*dot(v,n)*n;
30203020
}
@@ -3032,7 +3032,7 @@
30323032
};
30333033

30343034

3035-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
3035+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
30363036
class metal : public material {
30373037
public:
30383038
metal(const color& albedo) : albedo(albedo) {}
@@ -3329,7 +3329,7 @@
33293329
}
33303330

33313331

3332-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
3332+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
33333333
inline vec3 refract(const vec3& uv, const vec3& n, double etai_over_etat) {
33343334
auto cos_theta = std::fmin(dot(-uv, n), 1.0);
33353335
vec3 r_out_perp = etai_over_etat * (uv + cos_theta*n);
@@ -3352,7 +3352,7 @@
33523352
};
33533353

33543354

3355-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
3355+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
33563356
class dielectric : public material {
33573357
public:
33583358
dielectric(double refraction_index) : refraction_index(refraction_index) {}
@@ -4039,7 +4039,7 @@
40394039
}
40404040

40414041

4042-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
4042+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
40434043
inline vec3 random_in_unit_disk() {
40444044
while (true) {
40454045
auto p = vec3(random_double(-1,1), random_double(-1,1), 0);
@@ -4230,7 +4230,7 @@
42304230
hittable_list world;
42314231

42324232

4233-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
4233+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
42344234
auto ground_material = make_shared<lambertian>(color(0.5, 0.5, 0.5));
42354235
world.add(make_shared<sphere>(point3(0,-1000,0), 1000, ground_material));
42364236

@@ -4275,7 +4275,7 @@
42754275
camera cam;
42764276

42774277

4278-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ Highlight
4278+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
42794279
cam.aspect_ratio = 16.0 / 9.0;
42804280
cam.image_width = 1200;
42814281
cam.samples_per_pixel = 500;

books/acknowledgments.md.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
- Jason Stone
4949
- [JC-ProgJava](https://github.com/JC-ProgJava)
5050
- Jean Buckley
51+
- [Jeff Smith](https://github.com/whydoubt)
5152
- Joey Cho
5253
- [John Kilpatrick](https://github.com/rjkilpatrick)
5354
- [Kaan Eraslan](https://github.com/D-K-E)

0 commit comments

Comments
 (0)