Skip to content

Anchors with whitespace throw error #4659

@alvarotrigo

Description

@alvarotrigo

Description

Using anchors with a whitespace will generate an error and break fullPage.js

  anchors: ['demo here', 'section 2', 'section3'],

Also takes place when using data-anchor.

A simple solution is to automatically replace those for a dash: -.
This will avoid simple errors like this one.

Link to isolated reproduction with no external CSS / JS

https://codepen.io/alvarotrigo/pen/WNqVbYW

Steps to reproduce it

  1. Access https://codepen.io/alvarotrigo/pen/WNqVbYW
  2. Try to scroll down
  3. Open the JS console and see the error

Versions

All. Latest fullPage.js <= 4.0.29

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions