Skip to content

Commit

Permalink
fix spaces in code block for epub
Browse files Browse the repository at this point in the history
close #40
  • Loading branch information
roberto-butti committed Nov 28, 2024
1 parent c3d166c commit ddbc243
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.0.5 - 28th November 2024
- fix spaces in code block for epub

## 2.0.4 - 23th November 2024
- Fine tuning for PHP 8.4
- Adding "Books created with Ibis Next" section in readme
Expand Down
4 changes: 3 additions & 1 deletion src/Commands/BuildEpubCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected function buildEpub(

$book->addCSSFile("style.css", "css1", $this->getStyle($this->config->workingPath, "style"));
//$cssData = file_get_contents("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.css");
$cssData = file_get_contents("https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.16.2/build/styles/github-gist.min.css");
$cssData = file_get_contents("https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.5/build/styles/github-gist.min.css");

$book->addCSSFile("github.css", "css2", $cssData);
//
Expand Down Expand Up @@ -149,6 +149,8 @@ protected function buildEpub(
foreach ($chapters as $key => $chapter) {
$this->output->writeln('<fg=yellow>==></> ❇️ ' . $chapter["mdfile"] . ' ...');

// fixing html
$chapter["html"] = str_replace("</span> <span", "</span>&nbsp;<span", $chapter["html"]);
$book->addChapter(
chapterName: Arr::get($chapter, "frontmatter.title", "Chapter " . ($key + 1)),
fileName: "Chapter" . $key . ".html",
Expand Down

0 comments on commit ddbc243

Please sign in to comment.