Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a case for an empty book_title parameter #1145

Merged
merged 1 commit into from
Feb 16, 2020
Merged

Add a case for an empty book_title parameter #1145

merged 1 commit into from
Feb 16, 2020

Commits on Feb 15, 2020

  1. Add a case for an empty book_title parameter

    Html page title for every chapter in the book is created by the following code:
    ```rust
    let title: String;
    {
    	let book_title = ctx
    	.data
    	.get("book_title")
    	.and_then(serde_json::Value::as_str)
    	.unwrap_or("");
    
    	title = ch.name.clone() + " - " + book_title;
    }
    ```
    
    If the `book.toml` file is missing, and `book_title` parameter is empty, there's an awkward ` - ` string hanging at the end of each chapter's title.
    
    This PR adds a `match` case to handle that kind of situation.
    tomasz-rozanski committed Feb 15, 2020
    Configuration menu
    Copy the full SHA
    95fba3f View commit details
    Browse the repository at this point in the history