Skip to content

Rendering with offlineSearch fails: offline-search-index.json:750: comment ends before closing delimiter #705

@marians

Description

@marians

With hugo 0.88.1 and the latest Docsy from master I get the following error when rendering a site with offlineSearch = true:

Error: Error building site: EXECUTE-AS-TEMPLATE: failed to transform "offline-search-index.json" (application/json): failed to parse Resource "offline-search-index.json" as Template:: template: offline-search-index.json:750: comment ends before closing delimiter

The file mentioned is https://github.com/google/docsy/blob/ea64eddd6be4c754cb207e79ebd6a6ca05ea4f08/assets/json/offline-search-index.json

By trial and error I have narrowed down the problem to the rendering of the "body" attribute. When I remove the "body" (.Plain | htmlUnescape) part from the template, the error disappears and the file is generated just fine.

So I'm guessing the escaping of the body field isn't happening as it should be.

Unfortunately the content is not public. Anything I can do to narrow down the problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions