@rspress/core 1.7.4 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4192,6 +4192,11 @@ async function extractPageData(replaceRules, alias, domain, root, routeService2)
4192
4192
  selector: "img",
4193
4193
  format: "skip"
4194
4194
  },
4195
+ {
4196
+ // Skip code blocks
4197
+ selector: "pre > code",
4198
+ format: "skip"
4199
+ },
4195
4200
  ...["h1", "h2", "h3", "h4", "h5", "h6"].map((tag) => ({
4196
4201
  selector: tag,
4197
4202
  options: {
@@ -4861,9 +4866,9 @@ async function createInternalBuildConfig(userDocRoot, config, isSSR, routeServic
4861
4866
  setupMiddlewares: [
4862
4867
  (middlewares) => {
4863
4868
  if (isPublicDirExist) {
4864
- middlewares.push(sirv(publicDir));
4869
+ middlewares.unshift(sirv(publicDir));
4865
4870
  }
4866
- middlewares.push(serveSearchIndexMiddleware(config));
4871
+ middlewares.unshift(serveSearchIndexMiddleware(config));
4867
4872
  }
4868
4873
  ]
4869
4874
  },
@@ -5315,7 +5320,7 @@ async function renderPages(appDirectory, config, pluginDriver, enableSSG) {
5315
5320
  helmet?.link?.toString(),
5316
5321
  helmet?.style?.toString(),
5317
5322
  helmet?.script?.toString(),
5318
- CHECK_DARK_LIGHT_SCRIPT
5323
+ config.themeConfig?.darkMode !== false ? CHECK_DARK_LIGHT_SCRIPT : ""
5319
5324
  ]).join("")
5320
5325
  );
5321
5326
  if (helmet?.htmlAttributes) {