Skip to content

Commit

Permalink
Various maintenance (#28)
Browse files Browse the repository at this point in the history
* Various maintenance

- More package.json refactoring.
- Removed .npmignore in favor of `files` entry in package.json.
- Renamed dom-parser.js to domParser.js.
- Replaced CHANGELOG with more rigorous file.
- Replaced LICENSE with more rigorous file.
- Removed component.json (deprecated package manager https://github.com/componentjs/guide)
- `proof` devDep updated to latest.

Closes #2.
Closes #12.
Closes #20.

Requesting review from @brodybits @timbru31.

Pending approval and merge, we should release this as 0.2.2.

* CHANGELOG tweak

* Bump minor instead of patch

* Bump minor instead of patch

* fix tests?

* fix tests

* rename...

* fix tests

* fix package lock

* update CHANGELOG

and tilda proof.

* rename back

* update CHANGELOG

* consistency

* moving files to lib

* Update lib/dom-parser.js

Co-Authored-By: Chris Brody <chris.brody+brodybits@gmail.com>

* Update CHANGELOG.md

Co-Authored-By: Chris Brody <chris.brody+brodybits@gmail.com>

* past tense

Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>
  • Loading branch information
kethinov and brodybits committed Mar 4, 2020
1 parent 7c54a0b commit 004d20c
Show file tree
Hide file tree
Showing 15 changed files with 325 additions and 53 deletions.
5 changes: 0 additions & 5 deletions .npmignore

This file was deleted.

92 changes: 92 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,92 @@
## 0.3.0

- Node >=10.x now required.
- Added getElementsByClassName method.
- Added Node to the list of exports
- Added lowercase of åäö in entityMap.
- Moved existing sources into `lib` subdirectory.
- Removed `.npmignore` in favor of `files` entry in package.json.
- More `package.json` refactoring.
- Replaced CHANGELOG with more rigorous file.
- Replaced LICENSE with more rigorous file.
- Removed component.json (deprecated package manager https://github.com/componentjs/guide)
- `proof` devDep updated to latest.
- Fixed CI.
- README updates.

## 0.2.1

- More package.json refactoring.

## 0.2.0

- Now publishing under xmldom npm package again; retiring xmldom-alpha.
- Remove coveralls.
- Disable cache in travis.
- Other refactoring.

## 0.1.28 (via xmldom-alpha npm package)

- Removed __proto__ accessor.
- Appended HTML entities defaults.

## 0.1.27 (via xmldom-alpha npm package)

- Various bug fixes.
- Don't ask why 0.1.26 and 0.1.25 were skipped. `¯\_(ツ)_/¯`

## 0.1.24 (via xmldom-alpha package)

- Added node filter.

## 0.1.23 (via xmldom-alpha npm package)

- Added namespace support for nest node serialize.
- Various other bug fixes.

## 0.1.22

- Merge XMLNS serialization.
- Removed \r from source string.
- Print namespaces for child elements.
- Switch references to nodeType to use named constants.
- Add nodelist toString support.

## 0.1.21

- Fixed serialize bug.

## 0.1.20

- Optimized invalid XML support.
- Added toString sorter for attributes output.
- Added html self closed node button.
- Added `*` NS support for getElementsByTagNameNS.
- Converted attribute's value to string in setAttributeNS.
- Added support for HTML entities for HTML docs only.
- Fixed TypeError when Document is created with DocumentType.

## 0.1.19

- Fixed issue #68, infinite loop on unclosed comment.
- Added error report for unclosed tag.
- Various other fixes.

## 0.1.18

- Added default `ns` support.
- parseFromString now renders entirely plain text documents as textNode.
- Enabled option to ignore white space on parsing.

## 0.1.16

- Correctly handle multibyte Unicode greater than two byts. #57. #56.
- Initial unit testing and test coverage. #53. #46. #19.
- Create Bower `component.json` #52.

## 0.1.8

- Add: some test case from node-o3-xml(excludes xpath support)
- Fix: remove existed attribute before setting (bug introduced in v0.1.5)
- Fix: index direct access for childNodes and any NodeList collection(not w3c standard)
- Fix: remove last child bug
8 changes: 0 additions & 8 deletions LICENSE

This file was deleted.

4 changes: 4 additions & 0 deletions LICENSE.md
@@ -0,0 +1,4 @@
You can choose any one of these licenses:

- MIT: https://opensource.org/licenses/MIT
- LGPL: http://www.gnu.org/licenses/lgpl.html
2 changes: 1 addition & 1 deletion __package__.js
@@ -1,4 +1,4 @@
this.addScript('dom.js',['DOMImplementation','XMLSerializer']);
this.addScript('dom-parser.js',['DOMHandler','DOMParser'],
['DOMImplementation','XMLReader']);
this.addScript('sax.js','XMLReader');
this.addScript('sax.js','XMLReader');
14 changes: 0 additions & 14 deletions changelog

This file was deleted.

10 changes: 0 additions & 10 deletions component.json

This file was deleted.

15 changes: 7 additions & 8 deletions dom-parser.js → lib/dom-parser.js
@@ -1,6 +1,5 @@
function DOMParser(options){
this.options = options ||{locator:{}};

}

DOMParser.prototype.parseFromString = function(source,mimeType){
Expand All @@ -15,7 +14,7 @@ DOMParser.prototype.parseFromString = function(source,mimeType){
if(locator){
domBuilder.setDocumentLocator(locator)
}

sax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);
sax.domBuilder = options.domBuilder || domBuilder;
if(isHTML){
Expand Down Expand Up @@ -58,8 +57,8 @@ function buildErrorHandler(errorImpl,domBuilder,locator){
/**
* +ContentHandler+ErrorHandler
* +LexicalHandler+EntityResolver2
* -DeclHandler-DTDHandler
*
* -DeclHandler-DTDHandler
*
* DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler
* DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2
* @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html
Expand All @@ -74,7 +73,7 @@ function position(locator,node){
/**
* @see org.xml.sax.ContentHandler#startDocument
* @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html
*/
*/
DOMHandler.prototype = {
startDocument : function() {
this.doc = new DOMImplementation().createDocument(null, null, null);
Expand All @@ -88,7 +87,7 @@ DOMHandler.prototype = {
var len = attrs.length;
appendElement(this, el);
this.currentElement = el;

this.locator && position(this.locator,el)
for (var i = 0 ; i < len; i++) {
var namespaceURI = attrs.getURI(i);
Expand Down Expand Up @@ -151,15 +150,15 @@ DOMHandler.prototype = {
this.locator && position(this.locator,comm)
appendElement(this, comm);
},

startCDATA:function() {
//used in characters() methods
this.cdata = true;
},
endCDATA:function() {
this.cdata = false;
},

startDTD:function(name, publicId, systemId) {
var impl = this.doc.implementation;
if (impl && impl.createDocumentType) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 004d20c

Please sign in to comment.