webpro / reveal-md

reveal.js on steroids! Get beautiful reveal.js presentations from any Markdown file
MIT License
3.71k stars 416 forks source link

`hash: false` option doesn't work #487

Closed ooker777 closed 2 months ago

ooker777 commented 2 months ago

I want to turn off the hash so that my history doesn't mess up. I add:

revealOptions:
  hash: false

but it doesn't work.

webpro commented 2 months ago

What's in the HTML source, is it in there properly? There should be a <script> tag close to the closing </body> tag.

ooker777 commented 2 months ago
<script>
  function extend() {
    var target = {};
    for (var i = 0; i < arguments.length; i++) {
      var source = arguments[i];
      for (var key in source) {
        if (source.hasOwnProperty(key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  }

  // default options to init reveal.js
  var defaultOptions = {
    controls: true,
    progress: true,
    history: true,
    center: true,
    transition: 'default', // none/fade/slide/convex/concave/zoom
    slideNumber: true,
    highlight: {
      highlightOnLoad: false
    },
    plugins: [
      RevealMarkdown,
      RevealHighlight,
      RevealZoom,
      RevealNotes,
      RevealMath
    ]
  };

  // options from URL query string
  var queryOptions = Reveal().getQueryHash() || {};

  var options = extend(defaultOptions, {"transition":"slide","hash":false,"slideNumber":false,"history":"fasle","_":[".\\Đáp ứng nhu cầu doanh nghiệp.md"],"w":true,"watch":true}, queryOptions);
</script>
webpro commented 2 months ago

That looks alright to me, might be an issue with Reveal.js as well then. Haven't used this option myself.

Also I see a typo in "history":"fasle"

ooker777 commented 2 months ago

Hmm, it seems like setting history: false will turn off the hash as well. Meanwhile if you only set hash: false and let the history option as default, then the history is injected, even though the default value of it is false.