geojs 1.12.1 → 1.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geojs",
3
- "version": "1.12.1",
3
+ "version": "1.12.3",
4
4
  "description": "JavaScript Geo Visualization and Analysis Library",
5
5
  "homepage": "https://github.com/OpenGeoscience/geojs",
6
6
  "license": "Apache-2.0",
@@ -1665,6 +1665,7 @@ var mapInteractor = function (args) {
1665
1665
  // add information about the button state to the event information
1666
1666
  var details = m_this.mouse();
1667
1667
  details.buttonsDown = m_clickMaybe.buttons;
1668
+ details.evt = evt;
1668
1669
 
1669
1670
  // reset click detector variable
1670
1671
  m_this._setClickMaybe(false);
@@ -971,11 +971,22 @@ var util = {
971
971
  * @memberof geo.util
972
972
  */
973
973
  escapeUnicodeHTML: function (text) {
974
- return text.replace(/./g, function (k) {
974
+ return text.replace(/[^- 0-9A-Za-z~`!@#$%^&*()_+={}|[\]\\:";'<>?,./]/g, function (k, pos) {
975
975
  var code = k.charCodeAt(0);
976
976
  if (code < 127) {
977
977
  return k;
978
978
  }
979
+ /* decode utf016 surrogate pairs */
980
+ if (code >= 0xD800 && code <= 0xE000) {
981
+ if (code < 0xDC00 || pos) {
982
+ return '';
983
+ }
984
+ var code0 = text.charCodeAt(pos - 1);
985
+ if (code0 < 0xD800 || code0 >= 0xDC00) {
986
+ return '';
987
+ }
988
+ code = (code0 - 0xD800) * 0x400 + (code - 0xDC00);
989
+ }
979
990
  return '&#' + code.toString(10) + ';';
980
991
  });
981
992
  },