GithubHelp home page GithubHelp logo

Comments (9)

Expertium avatar Expertium commented on July 23, 2024 1

Thank you, now it's fixed. I'm going to check my other note types to make sure they don't have this problem.

from fsrs4anki.

L-M-Sherlock avatar L-M-Sherlock commented on July 23, 2024

Could you show me the value of deck_name? Use the inspector and run the code to line 32, then the value of deck_name will show in the scope.

from fsrs4anki.

Expertium avatar Expertium commented on July 23, 2024

image
Is this what you mean?

from fsrs4anki.

L-M-Sherlock avatar L-M-Sherlock commented on July 23, 2024

Yes. It's weird. It seems like the front didn't contain the deck name.

from fsrs4anki.

L-M-Sherlock avatar L-M-Sherlock commented on July 23, 2024

Can you switch to the element tab of the inspector? I want to check the div element in the front.

from fsrs4anki.

Expertium avatar Expertium commented on July 23, 2024

I checked some other decks and it seems like they are fine, so something is wrong either with this deck or with the cards in it.
Here's the screenshot, deck_name in Elements is correct, but when I get to line 32 and check code in the Sources tab it still says deck_name=null.
image

from fsrs4anki.

L-M-Sherlock avatar L-M-Sherlock commented on July 23, 2024

image

I find that an another element also has id=deck.

from fsrs4anki.

Expertium avatar Expertium commented on July 23, 2024

Ah, I guess there might be a problem with the card template.
Here's the code from the front of the card:

<div id="items">
	<div id="path"></div>
	<div id="deck">{{Deck}}</div>
	<div id="front">{{Front}}</div>
</div>
<script>
	deck = document.getElementById("deck");
	dName = deck.innerText.split("::")
	deck.innerHTML = dName[dName.length-1];
	document.getElementById("path").innerHTML = dName.join(" > ")
	function addTitle(id=false, title="") {
		let el = document.getElementById(id);
		if (el.innerText) {
			let t = document.createElement("div");
			t.classList.add("title");
			t.innerHTML = title;

			let b = document.createElement("div");
			b.classList.add("body");
			b.innerHTML = el.innerHTML;

			while(el.firstChild) {
				el.removeChild(el.firstChild);
			}
			el.append(t, b);
		} 
	}
	addTitle("front", "Q. ");
</script>

<div id=deck deck_name="{{Deck}}"></div>

from fsrs4anki.

L-M-Sherlock avatar L-M-Sherlock commented on July 23, 2024

Remove the line 3 of the template. It will solve the problem.

Edit: or move the end line to the first line.

from fsrs4anki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.