Reco Everything you wanna value. 자세히보기

[IT|Programming]/HTML related

마지막이 ```/ 로 끝나면 error 나는거 해결합시다.

kipid 2024. 8. 30. 12:30
반응형
▼ Hide
Toggle a mess
Go (FS)
TofC
DocuK Log
Backward
Forward
RRA
Lists
CmtZ
CmtX
Handle CmtZ
Log in
out focus
이 글이 도움이 되셨다면, 광고 클릭 한번씩만 부탁드립니다 =ㅂ=ㅋ.
(If this article was helpful, please click the ad once. Thank you. ;)
Mode: Bright; Font: Noto Sans KR; font-size: 16px; line-height: 1.5;
width: 1280, height: 720, version: 3.3.3
Canonical URI: https://kipid.tistory.com/entry/마지막이-CodeEnd-로-끝나면-error-나는거-해결합시다
dg:plink (Document Global Permanent Link): https://kipid.tistory.com/365
document.referrer: Empty
This document is rendered by docuK (See also SEE (Super Easy Edit) of docuK and pure SEE).

마지막이 ```/ 로 끝나면 error 나는거 해결합시다.

어랏 에러가 안나네. 뭐가 바뀐거지? =ㅂ=;;;

TPH1.Posting History

▼ Show/Hide

T1.Codes printed

▼ Show/Hide
On the left side of codes is there a hiden button to toggle/switch scrollability ({max-height:some} or {max-height:none}).
window.m = window.k = {}; // window.m can be asigned another JSON or number/string and so on. But window.k must be kept.
(function (m, $, undefined) {
m.version0 = "2.12";

m.getUTF8Length = function (s) {
	let len = 0;
	for (let i = 0; i < s.length; i++) {
		let code = s.charCodeAt(i);
		if (code <= 0x7f) {
			len += 1;
		}
		else if (code <= 0x7ff) {
			len += 2;
		}
		else if (code >= 0xd800 && code <= 0xdfff) {
			// Surrogate pair: These take 4 bytes in UTF-8 and 2 chars in UCS-2
			// (Assume next char is the other [valid] half and just skip it)
			len += 4; i++;
		}
		else if (code < 0xffff) {
			len += 3;
		}
		else {
			len += 4;
		}
	}
	return len;
};

m.getSearchVars = function (searchStr) {
	let vars = [];
	if (searchStr !== null && searchStr !== undefined && searchStr.length) {
		if (searchStr.startsWith("?")) { searchStr = searchStr.substring(1); }
		let j = searchStr.indexOf("#");
		if (j !== -1) { searchStr = searchStr.substring(0, j); }
		let splits = searchStr.replace(/&amp;/ig, "&").split("&");
		for (let i = 0; i < splits.length; i++) {
			let key = splits[i];
			let value = "";
			let k = key.indexOf("=");
			if (k !== -1) {
				value = decodeURIComponent(key.substring(k + 1));
				key = key.substring(0, k);
			}
			key = decodeURIComponent(key);
			vars[i] = vars[key] = { key: key, val: value };
		}
	}
	return vars;
};
On the left side of codes is there a hiden button to toggle/switch scrollability ({max-height:some} or {max-height:none}).
////////////////////////////////////////////////////
// Heap sort.
////////////////////////////////////////////////////
m.heapify = function (arr, key, sorted, n, i) {
	let largest = i;
	let l = 2 * i + 1;
	let r = 2 * i + 2;
	if (l < n && arr[sorted[l]][key] > arr[sorted[largest]][key]) {
		largest = l;
	}
	if (r < n && arr[sorted[r]][key] > arr[sorted[largest]][key]) {
		largest = r;
	}
	if (largest != i) {
		let swap = sorted[i];
		sorted[i] = sorted[largest];
		sorted[largest] = swap;
		m.heapify(arr, key, sorted, n, largest);
	}
};
m.heapsort = function (arr, key, sorted, upto) {
	let n = arr.length;
	for (let i = Math.floor(n / 2) - 1; i >= 0; i--) {
		m.heapify(arr, key, sorted, n, i);
	}
	if (upto) {
		upto = upto > n ? n : upto;
	}
	else {
		upto = n;
	}
	let until = n - upto;
	for (let i = n - 1; i >= until; i--) {
		let temp = sorted[0];
		sorted[0] = sorted[i];
		sorted[i] = temp;
		m.heapify(arr, key, sorted, i, 0);
	}
	return until;
};
m.heapsortRest = function (arr, key, sorted, upto, n) {
	upto = upto > n ? n : upto;
	let until = n - upto;
	for (let i = n - 1; i >= until; i--) {
		let temp = sorted[0];
		sorted[0] = sorted[i];
		sorted[i] = temp;
		m.heapify(arr, key, sorted, i, 0);
	}
	return until;
};

////////////////////////////////////////////////////
// URI rendering :: http link itself, videos, images, maps.
////////////////////////////////////////////////////
m.ptnURI = [];
m.ptnURL = /^https?:\/\/[^\s\t\n\r\"\'\`\<\>\{\}\[\]]+/i;
m.ptnFILE = /^file:\/\/\/[^\s\t\n\r\"\'\`\<\>\{\}\[\]]+/i;
m.ptnTag = /^<\w+[\s\S]+>/i;
m.ptnVal = /^([0-9]+(?:\.[0-9]+)?)\/([0-9]+(?:\.[0-9]+)?)$/;

m.uriToA = function (uri) {
	if (!uri || typeof uri !== "string") {
		uri = String(uri);
	}
	let exec = m.ptnURL.exec(uri);
	if (exec !== null) {
		return `<a target="_blank" href="${exec[0]}">${m.escapeOnlyTag(decodeURIComponent(uri).replace(/[\n\s\t\r]/g, " "))}</a>`;
	}
	else {
		exec = m.ptnFILE.exec(uri);
		if (exec !== null) {
			return `<a target="_blank" href="${exec[0]}">${m.escapeOnlyTag(decodeURIComponent(uri).replace(/[\n\s\t\r]/g, " "))}</a>`;
		}
		else {
			return m.escapeOnlyTag(uri);
		}
	}
};
})(window.k, jQuery);
▲ Hide

TRRA1.References and Related Articles

▼ Show/Hide
  1. Ref. [01] 에러 다시 생기게 만든건가?
▲ Hide
Toggle a mess
* 홍보/Promoting Recoeve.net (3S | Slow/Sexy/Sincere SNS)
유튜브 음악, K-Pop MV 들을 광고없이 목록재생 해서 보세요.
접속하셔서 가입 후 별점만 드레그 하시면 자신의 페이지에 저장 됩니다.
그리고 자신의 페이지로 이동한 뒤 추천 받기 (단축키 R) 를 누르시면 자신이 점수 메긴것들로 이웃 (이웃보기 단축키 B) 을 자동으로 찾아주고 그 이웃들로부터 추천을 받을 수 있습니다.
Toggle a mess
* 홍보/Promoting Recoeve.net (3S | Slow/Sexy/Sincere SNS)
츄츄와 루루 (포메라니안 6세/3.5kg, 3개월/1.2kg) 의 사진/동영상들을 모아 보세요.
접속하셔서 가입 후 별점만 드레그 하시면 자신의 페이지에 저장 됩니다.
그리고 자신의 페이지로 이동한 뒤 추천 받기 (단축키 R) 를 누르시면 자신이 점수 메긴것들로 이웃 (이웃보기 단축키 B) 을 자동으로 찾아주고 그 이웃들로부터 추천을 받을 수 있습니다.
Toggle a mess
이 글이 도움이 되셨다면, 광고 클릭 한번씩만 부탁드립니다 =ㅂ=ㅋ.
(If this article was helpful, please click the ad once. Thank you. ;)
반응형