8
0

to-markdown.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  1. (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.toMarkdown = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  2. /*
  3. * to-markdown - an HTML to Markdown converter
  4. *
  5. * Copyright 2011+, Dom Christie
  6. * Licenced under the MIT licence
  7. *
  8. */
  9. 'use strict'
  10. var toMarkdown
  11. var converters
  12. var mdConverters = require('./lib/md-converters')
  13. var gfmConverters = require('./lib/gfm-converters')
  14. var HtmlParser = require('./lib/html-parser')
  15. var collapse = require('collapse-whitespace')
  16. /*
  17. * Utilities
  18. */
  19. var blocks = ['address', 'article', 'aside', 'audio', 'blockquote', 'body',
  20. 'canvas', 'center', 'dd', 'dir', 'div', 'dl', 'dt', 'fieldset', 'figcaption',
  21. 'figure', 'footer', 'form', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
  22. 'header', 'hgroup', 'hr', 'html', 'isindex', 'li', 'main', 'menu', 'nav',
  23. 'noframes', 'noscript', 'ol', 'output', 'p', 'pre', 'section', 'table',
  24. 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'ul'
  25. ]
  26. function isBlock (node) {
  27. return blocks.indexOf(node.nodeName.toLowerCase()) !== -1
  28. }
  29. var voids = [
  30. 'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input',
  31. 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'
  32. ]
  33. function isVoid (node) {
  34. return voids.indexOf(node.nodeName.toLowerCase()) !== -1
  35. }
  36. function htmlToDom (string) {
  37. var tree = new HtmlParser().parseFromString(string, 'text/html')
  38. collapse(tree.documentElement, isBlock)
  39. return tree
  40. }
  41. /*
  42. * Flattens DOM tree into single array
  43. */
  44. function bfsOrder (node) {
  45. var inqueue = [node]
  46. var outqueue = []
  47. var elem
  48. var children
  49. var i
  50. while (inqueue.length > 0) {
  51. elem = inqueue.shift()
  52. outqueue.push(elem)
  53. children = elem.childNodes
  54. for (i = 0; i < children.length; i++) {
  55. if (children[i].nodeType === 1) inqueue.push(children[i])
  56. }
  57. }
  58. outqueue.shift()
  59. return outqueue
  60. }
  61. /*
  62. * Contructs a Markdown string of replacement text for a given node
  63. */
  64. function getContent (node) {
  65. var text = ''
  66. for (var i = 0; i < node.childNodes.length; i++) {
  67. if (node.childNodes[i].nodeType === 1) {
  68. text += node.childNodes[i]._replacement
  69. } else if (node.childNodes[i].nodeType === 3) {
  70. text += node.childNodes[i].data
  71. } else continue
  72. }
  73. return text
  74. }
  75. /*
  76. * Returns the HTML string of an element with its contents converted
  77. */
  78. function outer (node, content) {
  79. return node.cloneNode(false).outerHTML.replace('><', '>' + content + '<')
  80. }
  81. function canConvert (node, filter) {
  82. if (typeof filter === 'string') {
  83. return filter === node.nodeName.toLowerCase()
  84. }
  85. if (Array.isArray(filter)) {
  86. return filter.indexOf(node.nodeName.toLowerCase()) !== -1
  87. } else if (typeof filter === 'function') {
  88. return filter.call(toMarkdown, node)
  89. } else {
  90. throw new TypeError('`filter` needs to be a string, array, or function')
  91. }
  92. }
  93. function isFlankedByWhitespace (side, node) {
  94. var sibling
  95. var regExp
  96. var isFlanked
  97. if (side === 'left') {
  98. sibling = node.previousSibling
  99. regExp = / $/
  100. } else {
  101. sibling = node.nextSibling
  102. regExp = /^ /
  103. }
  104. if (sibling) {
  105. if (sibling.nodeType === 3) {
  106. isFlanked = regExp.test(sibling.nodeValue)
  107. } else if (sibling.nodeType === 1 && !isBlock(sibling)) {
  108. isFlanked = regExp.test(sibling.textContent)
  109. }
  110. }
  111. return isFlanked
  112. }
  113. function flankingWhitespace (node) {
  114. var leading = ''
  115. var trailing = ''
  116. if (!isBlock(node)) {
  117. var hasLeading = /^[ \r\n\t]/.test(node.innerHTML)
  118. var hasTrailing = /[ \r\n\t]$/.test(node.innerHTML)
  119. if (hasLeading && !isFlankedByWhitespace('left', node)) {
  120. leading = ' '
  121. }
  122. if (hasTrailing && !isFlankedByWhitespace('right', node)) {
  123. trailing = ' '
  124. }
  125. }
  126. return { leading: leading, trailing: trailing }
  127. }
  128. /*
  129. * Finds a Markdown converter, gets the replacement, and sets it on
  130. * `_replacement`
  131. */
  132. function process (node) {
  133. var replacement
  134. var content = getContent(node)
  135. // Remove blank nodes
  136. if (!isVoid(node) && !/A|TH|TD/.test(node.nodeName) && /^\s*$/i.test(content)) {
  137. node._replacement = ''
  138. return
  139. }
  140. for (var i = 0; i < converters.length; i++) {
  141. var converter = converters[i]
  142. if (canConvert(node, converter.filter)) {
  143. if (typeof converter.replacement !== 'function') {
  144. throw new TypeError(
  145. '`replacement` needs to be a function that returns a string'
  146. )
  147. }
  148. var whitespace = flankingWhitespace(node)
  149. if (whitespace.leading || whitespace.trailing) {
  150. content = content.trim()
  151. }
  152. replacement = whitespace.leading +
  153. converter.replacement.call(toMarkdown, content, node) +
  154. whitespace.trailing
  155. break
  156. }
  157. }
  158. node._replacement = replacement
  159. }
  160. toMarkdown = function (input, options) {
  161. options = options || {}
  162. if (typeof input !== 'string') {
  163. throw new TypeError(input + ' is not a string')
  164. }
  165. // Escape potential ol triggers
  166. input = input.replace(/(\d+)\. /g, '$1\\. ')
  167. var clone = htmlToDom(input).body
  168. var nodes = bfsOrder(clone)
  169. var output
  170. converters = mdConverters.slice(0)
  171. if (options.gfm) {
  172. converters = gfmConverters.concat(converters)
  173. }
  174. if (options.converters) {
  175. converters = options.converters.concat(converters)
  176. }
  177. // Process through nodes in reverse (so deepest child elements are first).
  178. for (var i = nodes.length - 1; i >= 0; i--) {
  179. process(nodes[i])
  180. }
  181. output = getContent(clone)
  182. return output.replace(/^[\t\r\n]+|[\t\r\n\s]+$/g, '')
  183. .replace(/\n\s+\n/g, '\n\n')
  184. .replace(/\n{3,}/g, '\n\n')
  185. }
  186. toMarkdown.isBlock = isBlock
  187. toMarkdown.isVoid = isVoid
  188. toMarkdown.outer = outer
  189. module.exports = toMarkdown
  190. },{"./lib/gfm-converters":2,"./lib/html-parser":3,"./lib/md-converters":4,"collapse-whitespace":7}],2:[function(require,module,exports){
  191. 'use strict'
  192. function cell (content, node) {
  193. var index = Array.prototype.indexOf.call(node.parentNode.childNodes, node)
  194. var prefix = ' '
  195. if (index === 0) prefix = '| '
  196. return prefix + content + ' |'
  197. }
  198. var highlightRegEx = /highlight highlight-(\S+)/
  199. module.exports = [
  200. {
  201. filter: 'br',
  202. replacement: function () {
  203. return '\n'
  204. }
  205. },
  206. {
  207. filter: ['del', 's', 'strike'],
  208. replacement: function (content) {
  209. return '~~' + content + '~~'
  210. }
  211. },
  212. {
  213. filter: function (node) {
  214. return node.type === 'checkbox' && node.parentNode.nodeName === 'LI'
  215. },
  216. replacement: function (content, node) {
  217. return (node.checked ? '[x]' : '[ ]') + ' '
  218. }
  219. },
  220. {
  221. filter: ['th', 'td'],
  222. replacement: function (content, node) {
  223. return cell(content, node)
  224. }
  225. },
  226. {
  227. filter: 'tr',
  228. replacement: function (content, node) {
  229. var borderCells = ''
  230. var alignMap = { left: ':--', right: '--:', center: ':-:' }
  231. if (node.parentNode.nodeName === 'THEAD') {
  232. for (var i = 0; i < node.childNodes.length; i++) {
  233. var align = node.childNodes[i].attributes.align
  234. var border = '---'
  235. if (align) border = alignMap[align.value] || border
  236. borderCells += cell(border, node.childNodes[i])
  237. }
  238. }
  239. return '\n' + content + (borderCells ? '\n' + borderCells : '')
  240. }
  241. },
  242. {
  243. filter: 'table',
  244. replacement: function (content) {
  245. return '\n\n' + content + '\n\n'
  246. }
  247. },
  248. {
  249. filter: ['thead', 'tbody', 'tfoot'],
  250. replacement: function (content) {
  251. return content
  252. }
  253. },
  254. // Fenced code blocks
  255. {
  256. filter: function (node) {
  257. return node.nodeName === 'PRE' &&
  258. node.firstChild &&
  259. node.firstChild.nodeName === 'CODE'
  260. },
  261. replacement: function (content, node) {
  262. return '\n\n```\n' + node.firstChild.textContent + '\n```\n\n'
  263. }
  264. },
  265. // Syntax-highlighted code blocks
  266. {
  267. filter: function (node) {
  268. return node.nodeName === 'PRE' &&
  269. node.parentNode.nodeName === 'DIV' &&
  270. highlightRegEx.test(node.parentNode.className)
  271. },
  272. replacement: function (content, node) {
  273. var language = node.parentNode.className.match(highlightRegEx)[1]
  274. return '\n\n```' + language + '\n' + node.textContent + '\n```\n\n'
  275. }
  276. },
  277. {
  278. filter: function (node) {
  279. return node.nodeName === 'DIV' &&
  280. highlightRegEx.test(node.className)
  281. },
  282. replacement: function (content) {
  283. return '\n\n' + content + '\n\n'
  284. }
  285. }
  286. ]
  287. },{}],3:[function(require,module,exports){
  288. /*
  289. * Set up window for Node.js
  290. */
  291. var _window = (typeof window !== 'undefined' ? window : this)
  292. /*
  293. * Parsing HTML strings
  294. */
  295. function canParseHtmlNatively () {
  296. var Parser = _window.DOMParser
  297. var canParse = false
  298. // Adapted from https://gist.github.com/1129031
  299. // Firefox/Opera/IE throw errors on unsupported types
  300. try {
  301. // WebKit returns null on unsupported types
  302. if (new Parser().parseFromString('', 'text/html')) {
  303. canParse = true
  304. }
  305. } catch (e) {}
  306. return canParse
  307. }
  308. function createHtmlParser () {
  309. var Parser = function () {}
  310. // For Node.js environments
  311. if (typeof document === 'undefined') {
  312. var jsdom = require('jsdom')
  313. Parser.prototype.parseFromString = function (string) {
  314. return jsdom.jsdom(string, {
  315. plugins: {
  316. FetchExternalResources: [],
  317. ProcessExternalResources: false
  318. }
  319. })
  320. }
  321. } else {
  322. if (!shouldUseActiveX()) {
  323. Parser.prototype.parseFromString = function (string) {
  324. var doc = document.implementation.createHTMLDocument('')
  325. doc.open()
  326. doc.write(string)
  327. doc.close()
  328. return doc
  329. }
  330. } else {
  331. Parser.prototype.parseFromString = function (string) {
  332. var doc = new window.ActiveXObject('htmlfile')
  333. doc.designMode = 'on' // disable on-page scripts
  334. doc.open()
  335. doc.write(string)
  336. doc.close()
  337. return doc
  338. }
  339. }
  340. }
  341. return Parser
  342. }
  343. function shouldUseActiveX () {
  344. var useActiveX = false
  345. try {
  346. document.implementation.createHTMLDocument('').open()
  347. } catch (e) {
  348. if (window.ActiveXObject) useActiveX = true
  349. }
  350. return useActiveX
  351. }
  352. module.exports = canParseHtmlNatively() ? _window.DOMParser : createHtmlParser()
  353. },{"jsdom":6}],4:[function(require,module,exports){
  354. 'use strict'
  355. module.exports = [
  356. {
  357. filter: 'p',
  358. replacement: function (content) {
  359. return '\n\n' + content + '\n\n'
  360. }
  361. },
  362. {
  363. filter: 'br',
  364. replacement: function () {
  365. return ' \n'
  366. }
  367. },
  368. {
  369. filter: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
  370. replacement: function (content, node) {
  371. var hLevel = node.nodeName.charAt(1)
  372. var hPrefix = ''
  373. for (var i = 0; i < hLevel; i++) {
  374. hPrefix += '#'
  375. }
  376. return '\n\n' + hPrefix + ' ' + content + '\n\n'
  377. }
  378. },
  379. {
  380. filter: 'hr',
  381. replacement: function () {
  382. return '\n\n* * *\n\n'
  383. }
  384. },
  385. {
  386. filter: ['em', 'i'],
  387. replacement: function (content) {
  388. return '_' + content + '_'
  389. }
  390. },
  391. {
  392. filter: ['strong', 'b'],
  393. replacement: function (content) {
  394. return '**' + content + '**'
  395. }
  396. },
  397. // Inline code
  398. {
  399. filter: function (node) {
  400. var hasSiblings = node.previousSibling || node.nextSibling
  401. var isCodeBlock = node.parentNode.nodeName === 'PRE' && !hasSiblings
  402. return node.nodeName === 'CODE' && !isCodeBlock
  403. },
  404. replacement: function (content) {
  405. return '`' + content + '`'
  406. }
  407. },
  408. {
  409. filter: function (node) {
  410. return node.nodeName === 'A' && node.getAttribute('href')
  411. },
  412. replacement: function (content, node) {
  413. var titlePart = node.title ? ' "' + node.title + '"' : ''
  414. return '[' + content + '](' + node.getAttribute('href') + titlePart + ')'
  415. }
  416. },
  417. {
  418. filter: 'img',
  419. replacement: function (content, node) {
  420. var alt = node.alt || ''
  421. var src = node.getAttribute('src') || ''
  422. var title = node.title || ''
  423. var titlePart = title ? ' "' + title + '"' : ''
  424. return src ? '![' + alt + ']' + '(' + src + titlePart + ')' : ''
  425. }
  426. },
  427. // Code blocks
  428. {
  429. filter: function (node) {
  430. return node.nodeName === 'PRE' && node.firstChild.nodeName === 'CODE'
  431. },
  432. replacement: function (content, node) {
  433. return '\n\n ' + node.firstChild.textContent.replace(/\n/g, '\n ') + '\n\n'
  434. }
  435. },
  436. {
  437. filter: 'blockquote',
  438. replacement: function (content) {
  439. content = content.trim()
  440. content = content.replace(/\n{3,}/g, '\n\n')
  441. content = content.replace(/^/gm, '> ')
  442. return '\n\n' + content + '\n\n'
  443. }
  444. },
  445. {
  446. filter: 'li',
  447. replacement: function (content, node) {
  448. content = content.replace(/^\s+/, '').replace(/\n/gm, '\n ')
  449. var prefix = '* '
  450. var parent = node.parentNode
  451. var index = Array.prototype.indexOf.call(parent.children, node) + 1
  452. prefix = /ol/i.test(parent.nodeName) ? index + '. ' : '* '
  453. return prefix + content
  454. }
  455. },
  456. {
  457. filter: ['ul', 'ol'],
  458. replacement: function (content, node) {
  459. var strings = []
  460. for (var i = 0; i < node.childNodes.length; i++) {
  461. strings.push(node.childNodes[i]._replacement)
  462. }
  463. if (/li/i.test(node.parentNode.nodeName)) {
  464. return '\n' + strings.join('\n')
  465. }
  466. return '\n\n' + strings.join('\n') + '\n\n'
  467. }
  468. },
  469. {
  470. filter: function (node) {
  471. return this.isBlock(node)
  472. },
  473. replacement: function (content, node) {
  474. return '\n\n' + this.outer(node, content) + '\n\n'
  475. }
  476. },
  477. // Anything else!
  478. {
  479. filter: function () {
  480. return true
  481. },
  482. replacement: function (content, node) {
  483. return this.outer(node, content)
  484. }
  485. }
  486. ]
  487. },{}],5:[function(require,module,exports){
  488. /**
  489. * This file automatically generated from `build.js`.
  490. * Do not manually edit.
  491. */
  492. module.exports = [
  493. "address",
  494. "article",
  495. "aside",
  496. "audio",
  497. "blockquote",
  498. "canvas",
  499. "dd",
  500. "div",
  501. "dl",
  502. "fieldset",
  503. "figcaption",
  504. "figure",
  505. "footer",
  506. "form",
  507. "h1",
  508. "h2",
  509. "h3",
  510. "h4",
  511. "h5",
  512. "h6",
  513. "header",
  514. "hgroup",
  515. "hr",
  516. "main",
  517. "nav",
  518. "noscript",
  519. "ol",
  520. "output",
  521. "p",
  522. "pre",
  523. "section",
  524. "table",
  525. "tfoot",
  526. "ul",
  527. "video"
  528. ];
  529. },{}],6:[function(require,module,exports){
  530. },{}],7:[function(require,module,exports){
  531. 'use strict';
  532. var voidElements = require('void-elements');
  533. Object.keys(voidElements).forEach(function (name) {
  534. voidElements[name.toUpperCase()] = 1;
  535. });
  536. var blockElements = {};
  537. require('block-elements').forEach(function (name) {
  538. blockElements[name.toUpperCase()] = 1;
  539. });
  540. /**
  541. * isBlockElem(node) determines if the given node is a block element.
  542. *
  543. * @param {Node} node
  544. * @returns {Boolean}
  545. */
  546. function isBlockElem(node) {
  547. return !!(node && blockElements[node.nodeName]);
  548. }
  549. /**
  550. * isVoid(node) determines if the given node is a void element.
  551. *
  552. * @param {Node} node
  553. * @returns {Boolean}
  554. */
  555. function isVoid(node) {
  556. return !!(node && voidElements[node.nodeName]);
  557. }
  558. /**
  559. * whitespace(elem [, isBlock]) removes extraneous whitespace from an
  560. * the given element. The function isBlock may optionally be passed in
  561. * to determine whether or not an element is a block element; if none
  562. * is provided, defaults to using the list of block elements provided
  563. * by the `block-elements` module.
  564. *
  565. * @param {Node} elem
  566. * @param {Function} blockTest
  567. */
  568. function collapseWhitespace(elem, isBlock) {
  569. if (!elem.firstChild || elem.nodeName === 'PRE') return;
  570. if (typeof isBlock !== 'function') {
  571. isBlock = isBlockElem;
  572. }
  573. var prevText = null;
  574. var prevVoid = false;
  575. var prev = null;
  576. var node = next(prev, elem);
  577. while (node !== elem) {
  578. if (node.nodeType === 3) {
  579. // Node.TEXT_NODE
  580. var text = node.data.replace(/[ \r\n\t]+/g, ' ');
  581. if ((!prevText || / $/.test(prevText.data)) && !prevVoid && text[0] === ' ') {
  582. text = text.substr(1);
  583. }
  584. // `text` might be empty at this point.
  585. if (!text) {
  586. node = remove(node);
  587. continue;
  588. }
  589. node.data = text;
  590. prevText = node;
  591. } else if (node.nodeType === 1) {
  592. // Node.ELEMENT_NODE
  593. if (isBlock(node) || node.nodeName === 'BR') {
  594. if (prevText) {
  595. prevText.data = prevText.data.replace(/ $/, '');
  596. }
  597. prevText = null;
  598. prevVoid = false;
  599. } else if (isVoid(node)) {
  600. // Avoid trimming space around non-block, non-BR void elements.
  601. prevText = null;
  602. prevVoid = true;
  603. }
  604. } else {
  605. node = remove(node);
  606. continue;
  607. }
  608. var nextNode = next(prev, node);
  609. prev = node;
  610. node = nextNode;
  611. }
  612. if (prevText) {
  613. prevText.data = prevText.data.replace(/ $/, '');
  614. if (!prevText.data) {
  615. remove(prevText);
  616. }
  617. }
  618. }
  619. /**
  620. * remove(node) removes the given node from the DOM and returns the
  621. * next node in the sequence.
  622. *
  623. * @param {Node} node
  624. * @returns {Node} node
  625. */
  626. function remove(node) {
  627. var next = node.nextSibling || node.parentNode;
  628. node.parentNode.removeChild(node);
  629. return next;
  630. }
  631. /**
  632. * next(prev, current) returns the next node in the sequence, given the
  633. * current and previous nodes.
  634. *
  635. * @param {Node} prev
  636. * @param {Node} current
  637. * @returns {Node}
  638. */
  639. function next(prev, current) {
  640. if (prev && prev.parentNode === current || current.nodeName === 'PRE') {
  641. return current.nextSibling || current.parentNode;
  642. }
  643. return current.firstChild || current.nextSibling || current.parentNode;
  644. }
  645. module.exports = collapseWhitespace;
  646. },{"block-elements":5,"void-elements":8}],8:[function(require,module,exports){
  647. /**
  648. * This file automatically generated from `pre-publish.js`.
  649. * Do not manually edit.
  650. */
  651. module.exports = {
  652. "area": true,
  653. "base": true,
  654. "br": true,
  655. "col": true,
  656. "embed": true,
  657. "hr": true,
  658. "img": true,
  659. "input": true,
  660. "keygen": true,
  661. "link": true,
  662. "menuitem": true,
  663. "meta": true,
  664. "param": true,
  665. "source": true,
  666. "track": true,
  667. "wbr": true
  668. };
  669. },{}]},{},[1])(1)
  670. });