Notion.so Colored Checklist with No Strikethrough

This script prevents Notion from adding a strikethrough style to checked items in a todo list, while retaining any custom text colors.

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name Notion.so Colored Checklist with No Strikethrough 
// @description This script prevents Notion from adding a strikethrough style to checked items in a todo list, while retaining any custom text colors.
// @namespace Tampermonkey Scripts
// @match https://www.notion.so/*
// @grant none
// @version 1.0.0
// @license MIT
// ==/UserScript==
// 

function restyleCheckedTodos(elements){
  elements.forEach((e) => {
    if(e.style.textDecoration.includes('line-through')){
      e.style.textDecoration = 'none';
    }
  });
}

let config = {
  attributes: true,
  attributeFilter: ["style"],
  childList: true,
  subtree: true
};

let observer = new MutationObserver((mutationsList, observer) => {
	// Any elements recently added or edited.
	restyleCheckedTodos(mutationsList.map((m) => m.target));
	// Anything that was missed by the above.
    restyleCheckedTodos(document.querySelectorAll("[contenteditable]"));
});

observer.observe(document, config);