Skip to content

Commit

Permalink
fix(puppeteer): fix tex input escape
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Mar 28, 2021
1 parent dc7d832 commit d8b0f75
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/plugin-puppeteer/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import puppeteer, { Shooter } from 'puppeteer-core'
import { Context } from 'koishi-core'
import { Logger, defineProperty, noop, segment } from 'koishi-utils'
import { Context, Logger, defineProperty, noop, segment } from 'koishi-core'
import { escape } from 'querystring'
import { PNG } from 'pngjs'
export * from './svg'
Expand Down Expand Up @@ -178,7 +177,7 @@ export function apply(ctx: Context, config: Config = {}) {
height: 1080,
deviceScaleFactor: options.scale,
})
await page.goto('https://www.zhihu.com/equation?tex=' + escape(tex))
await page.goto('https://www.zhihu.com/equation?tex=' + escape(segment.unescape(tex)))
const svg = await page.$('svg')
const inner = await svg.evaluate(node => node.innerHTML)
const text = inner.match(/>([^<]+)<\/text>/)
Expand Down

0 comments on commit d8b0f75

Please sign in to comment.