跳至主要內容

Typora

LincZero小于 1 分钟

Typora

Typora语法高亮原理

Typora的代码块语法高亮使用的是CodeMirroropen in new window实现的

参考:

/* https://www.cnblogs.com/Anber82/p/14120414.html */
/* 点击主题化:https://codemirror.net/ */
/* https://codemirror.net/theme/ */
/* 将其代码中所有的.cm-s-dracula改为.cm-s-inner */
/* Based on Sublime Text's Monokai theme */
import React


我选的主题应该是:material-darker

function findSequence(goal) {
  function find(start, history) {
    if (start == goal)
      return history;
    else if (start > goal)
      return null;
    else
      return find(start + 5, "(" + history + " + 5)") ||
             find(start * 3, "(" + history + " * 3)");
  }
  return find(1, "1");
}