parsiya / Hugo-Octopress

Port of the classic Octopress theme to Hugo
MIT License
155 stars 52 forks source link

Error: While parsing config: (80, 19): unescaped control character U+0009 #28

Closed caijun closed 7 years ago

caijun commented 8 years ago

Thank you for developing this hugo theme.

I used the sample-config.toml to configure my hugo website, and then ran hugo server --watch, but following error was produced.

Error: While parsing config: (80, 19): unescaped control character U+0009

The error seems like from the Sidebar text param. How to fix this problem?

parsiya commented 7 years ago

Hey Sorry for the delay. I have not had time to check GH recently. Let me check it and get back to you. Hopefully I can find a fix over the weekend.

parsiya commented 7 years ago

Are you using it on *nix compatible system? The sample file was created on Windows which adds 0x0D 0x0A at the end of each file. 0x09 is the ASCIIHEX of tab which is the

I cannot reproduce this on Windows but try copy/pasting the text inside the file (or grab it from the Github web interface) to a new empty file in an editor on your OS which will hopefully fix the compatibility issue.

caijun commented 7 years ago

Yes, I am using Mac OS. I will try your suggestion and report the result. Thank you very much.

caijun commented 7 years ago

Hi @parsiya , I tried your solution, but it couldn't fix the problem and the same error is produced. I commented the sidebarText param, and it successfully produced the website. This additional info may help you to diagnose the problem.

    #sidebarText = """Sidebar text is passed to *markdownify* so it supports markdown. Here's a [link to google](https://www.google.com)
    #</br>
    #Second line
    #</br>
    #Third line
    #"""
parsiya commented 7 years ago

Unfortunately I do not have a Mac to reproduce this. I just tried it on Debian distro and it worked.

At this point you can try two things:

  1. Use a different format for the config file. I think Hugo supports yaml and json. There should be converters from toml to json/yaml. Here's the sample config in json: https://gist.github.com/parsiya/f0b947f9ef094387351d957e61790c23.
  2. Remove the tabs at the start of second line until the end of the string. Because Hugo does not like the tab at the start of second line.
ghost commented 7 years ago

I fixed this by replacing all TAB characters with spaces in config.toml.

caijun commented 7 years ago

Great. I will try your solution.

caijun commented 7 years ago

@plopix2 I fixed the problem by your solution. Thanks.

parsiya commented 7 years ago

I have converted all tabs to spaces in the sample-config now. Hopefully this will prevent problems in the future.