Skip to content

Commit

Permalink
fix regex bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
domlet committed Jul 8, 2024
1 parent 483b0d9 commit 0f14a23
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<script type="text/javascript" src="data/SY2425.js"></script>
<script type="text/javascript" src="data/SY2526.js"></script>
<script src="script/jquery-3.7.1.min.js"></script>

</head>

<body>
Expand Down
1 change: 0 additions & 1 deletion script/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ function drawDots(schoolYear) {
// 6 terms
// Draw filled dots (for elapsed days)
dotsHtml = "";
console.log(schoolYear.terms[0].termDaysElapsed);
for (let x = 0; x < schoolYear.terms[i].termDaysElapsed; x++) {
let date = schoolYear.terms[i].beg;
let dateCute = date.toLocaleString("en-US", dotsDateOptions); // Tooltip
Expand Down
11 changes: 8 additions & 3 deletions script/scriptEventLists.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,15 @@ function showEvents(eventsArray) {
/<[^>]*>/g,
""
);
// add spaces after periods
// add spaces after '.' (except .com...)
eventsArray[i].description = eventsArray[i].description.replace(
/\.(\S)/g,
". $1"
/\.(?!\s|co\b|org\b|net\b)/g,
". "
);
// add spaces after ':' (except '://')
eventsArray[i].description = eventsArray[i].description.replace(
/\:(?!\s|\/\/\b)/g,
": "
);
}
// truncate any long titles or desc
Expand Down

0 comments on commit 0f14a23

Please sign in to comment.