From 77f923baf2fb7fe63975559113585e90db7810ae Mon Sep 17 00:00:00 2001
From: Charles Iliya Krempeaux
Date: Thu, 16 Nov 2023 18:43:26 -0800
Subject: [PATCH] title="" -> name=""
---
README.md | 2 +-
ziba.js | 6 +++---
ziba_test.js | 12 +++++-------
3 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/README.md b/README.md
index 96d89c8..c80edb4 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ Here is an example usage of **ziba.js**:
Notice that the text and the href are the same.
- Here is another one fource
+ Here is another one fource
This ziba tag will get turned into fource
Notice that the href now has the value of the title of the ziba-link
diff --git a/ziba.js b/ziba.js
index c598a7d..b8eef95 100644
--- a/ziba.js
+++ b/ziba.js
@@ -67,9 +67,9 @@ function transform_link(rootElement) {
anchor.innerHTML = element.innerHTML
let ref = element.innerText
- const elementTitle = element.getAttribute("title")
- if (elementTitle) {
- ref = elementTitle
+ const elementName = element.getAttribute("name")
+ if (elementName) {
+ ref = elementName
}
const transform = element.getAttribute("transform")
diff --git a/ziba_test.js b/ziba_test.js
index 03749eb..a8d24b2 100644
--- a/ziba_test.js
+++ b/ziba_test.js
@@ -44,26 +44,26 @@ function testTransform() {
{
- html:'once',
+ html:'once',
expected:'once',
},
{
- html:'twice',
+ html:'twice',
expected:'twice',
},
{
- html:'thrice',
+ html:'thrice',
expected:'thrice',
},
{
- html:'fource',
+ html:'fource',
expected:'fource',
},
{
- html:'ONCE TWICE THRICE FOURCE',
+ html:'ONCE TWICE THRICE FOURCE',
expected:'ONCE TWICE THRICE FOURCE',
},
@@ -285,7 +285,6 @@ function testTransform() {
},
]
-
tests.forEach(function(test, testNumber){
if (undefined === ziba.transform) {
console.error("[test-tramsform] For test", testNumber, "ziba.transform is undefined.")
@@ -312,5 +311,4 @@ function testTransform() {
console.log("[test-tramsform] Test №", testNumber, "passed.")
})
-
}