docs-and-graphs
Advanced tools
Comparing version 0.1.7 to 0.1.8
{ | ||
"name": "docs-and-graphs", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "", |
@@ -45,6 +45,12 @@ const PARENTHESIS_TYPES = [ | ||
// Accepts embedded pairs between brackets, [like:: this] (or like::this) | ||
// Accepts embedded pairs between parentheses (like::this) | ||
function extractInlineFields (str) { | ||
const content = parseWithParenthesis(str) | ||
return content.length ? content : parseWithoutParenthesis(str) | ||
const extractFromLine = (line) => { | ||
const content = parseWithParenthesis(line) | ||
return content.length ? content : parseWithoutParenthesis(line) | ||
} | ||
return str.split('\n').map(extractFromLine).flat() | ||
} | ||
@@ -51,0 +57,0 @@ |
@@ -24,3 +24,6 @@ import { expect } from 'expect' | ||
'[[Alice]] :: foaf:knows :: [[Bob]]', | ||
'http://example.org :: is a :: website'] | ||
'http://example.org :: is a :: website', | ||
'a::b::c\na::f::d', | ||
'Several lines\na::b\na::f' | ||
] | ||
@@ -32,8 +35,3 @@ expect.extend({ toMatchSnapshot }) | ||
it(current, async function () { | ||
const fields = extractInlineFields(current) | ||
console.log(current) | ||
console.log(fields) | ||
expect(fields).toMatchSnapshot(this) | ||
@@ -47,5 +45,3 @@ }) | ||
it(current, async function () { | ||
const text = removeInlineFields(current) | ||
expect(text).toMatchSnapshot(this) | ||
@@ -52,0 +48,0 @@ }) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
260863
5760