Skip to content

Commit 22f4ae9

Browse files
committed
Version 1.0.1
Fixes JDMCreator#3 and JDMCreator#4 See changelog for details
1 parent 60c65b9 commit 22f4ae9

File tree

6 files changed

+41
-13
lines changed

6 files changed

+41
-13
lines changed

readme.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
## LaTeX Table Editor ##
22

3-
**Version 0.9.1**
3+
**Version 1.0.1**
44

5-
This is the GitHub page of an Open Source WYSIWYG table editor that exports to multiples languages including LaTeX, Plain TeX, CSV, HTML, BBCode, Eplain and Markdown.
5+
This is the GitHub page of an Open Source WYSIWYG table editor that exports to multiples languages including LaTeX, Plain TeX, CSV, HTML, BBCode, Eplain, PreTeXt and Markdown.
66

77
### Use
88

99
You can use it [here](http://www.latex-tables.com/).
1010

1111
### Dependencies
1212

13-
You need Bootstrap 3 and JQuery. See the online example.
13+
You need Bootstrap 3, ntc.js and JQuery. See the online example.
1414

1515
### Formats supported
1616

@@ -22,13 +22,14 @@ You need Bootstrap 3 and JQuery. See the online example.
2222
- CSV
2323
- BBCode
2424
- Eplain
25+
- PreTeXt
2526
- Text (coming soon)
2627
- ConTeXt (coming soon)
2728
- MediaWiki (coming soon)
2829

2930
### Status
3031

31-
The **LaTeX Table Editor** is in beta. No API is stable for now.
32+
The **LaTeX Table Editor** is now a stable release. No public API is documented for now.
3233

3334
### Report an issue
3435

src/changelog.txt

+19-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,24 @@ Legend
66
[#] Fixed
77
Dates use a YYYY/MM/DD format.
88

9-
Version 1.0
9+
Version 1.0.1 (2018/03/06)
10+
===========
11+
12+
| Note on this release :
13+
| Fix an issue with colorpicker and export to PreTeXt
14+
15+
CORE
16+
17+
[#] The system colorpicker didn't use the actual color
18+
19+
PRETEXT EXPORT
20+
21+
[/] Changed default indentation to two spaces
22+
[#] Fix an issue where special characters in equations were converted to XML
23+
[#] Replace <,>,& with \lt, \gt, \amp in equations
24+
25+
26+
Version 1.0 (2018/03/01)
1027
===========
1128

1229
| First stable release.
@@ -61,7 +78,7 @@ PRETEXT EXPORT
6178

6279
[+] New PreTeXt export module
6380

64-
Version 0.9.1 BETA
81+
Version 0.9.1 BETA (2018/01/18)
6582
===========
6683

6784
| Note on this release :

src/colorPicker.js

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ console.log(h);
6767
$("colorpicker-b").value = color[2];
6868
$("colorpicker-rgb").value = rgb;
6969
$("colorpicker-hex").value = hex;
70+
$("colorpicker-system-input").value = hex;
7071
$("colorpicker-hsl").value = hsl;
7172
$("colorpicker-container").style.color = hex;
7273
$("colorpicker-name").innerHTML = name;

src/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ <h5>Default Colors</h5>
468468
</div>
469469
<div style="text-align:center;">
470470
<label>
471-
<input type="color" oninput="ColorPicker.color(this.value)" hidden>
471+
<input type="color" oninput="ColorPicker.color(this.value)" id="colorpicker-system-input" hidden>
472472
<a type="button" data-toggle="tooltip" title="Use system colorpicker" class="btn btn-default"><span class="glyphicon glyphicon-tint"></span></a>
473473
</label>
474474
<div class="btn-group" role="group" aria-label="...">
@@ -667,7 +667,7 @@ <h4>Eplain options</h4>
667667
<h4>PreTeXt options</h4>
668668
<h5>Indentation</h5>
669669
<select id="opt-pretext-indent" class="form-control"><option value="tab">Tab</option>
670-
<option value="two">Two spaces</option>
670+
<option value="two" selected>Two spaces</option>
671671
<option value="four">Four spaces</option></select>
672672
</div>
673673
</div>

src/js.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function $id(id) {
102102
return "[rgb]{"+sep+"}";
103103
},
104104
table = new(function() {
105-
this.version = "1.0";
105+
this.version = "1.0.1";
106106
this.create = function(cols, rows) {
107107
rows = parseInt(rows, 10);
108108
cols = parseInt(cols, 10);

src/toPreTeXt.js

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(function(){
2-
var indent = "tab";
2+
var indent = "two";
33
function beautify(html){
44
var str = ""
55
html = html.replace(/<\s*(\/?)\s*([a-z]+)[^>]*>/gi,function(full,close,name){
@@ -31,10 +31,14 @@
3131
var getContent = function(cell){
3232
var container = (cell.refCell||cell).cell.cloneNode(true);
3333
// First, we take care of math
34-
var equations = container.querySelectorAll("span.latex-equation");
34+
var equations = container.querySelectorAll("span.latex-equation"),
35+
equationArr = [];
3536
for(var i=0,eq;i<equations.length;i++){
3637
eq = equations[i];
37-
var text = document.createTextNode("****m****"+(eq.innerText || eq.textContent).replace(/\n\r/g, "")+"****/m****");
38+
var text = document.createTextNode("****m"+equationArr.length+"****"),
39+
contentMath = (eq.innerText||eq.textContent).replace(/[\n\r]+/g, "")
40+
.replace(/</g, "\\lt ").replace(/>/g, "\\gt ").replace(/\&/g, "\\amp ");
41+
equationArr.push(contentMath);
3842
eq.parentNode.replaceChild(text, eq);
3943
}
4044
var text = container.innerText.replace(/([^\n\r])[\n\r]+$/, "$1");
@@ -57,7 +61,12 @@
5761
">" : "greater"
5862
}[char]+">";
5963
});
60-
text = text.replace(/\*\*\*\*(\/?(?:line|m))\*\*\*\*/g, function(full, name){
64+
text = text.replace(/\*\*\*\*(\/?(?:line|m\d+))\*\*\*\*/g, function(full, name){
65+
if(name.charAt(0) == "m"){
66+
name = +(name.substring(1));
67+
var contentMath = equationArr[name];
68+
return "<m>"+contentMath+"</m>";
69+
}
6170
return "<"+name+">";
6271
});
6372
var frag = document.createDocumentFragment(),

0 commit comments

Comments
 (0)