/** * Compress HTML * * This is a heavy regex-based removal of whitespace, unnecessary comments and * tokens. IE conditional comments are preserved. There are also options to have * STYLE and SCRIPT blocks compressed by callback functions. * * A test suite is available. * * @package Minify * @author Stephen Clay */ namespace LiteSpeed\Lib ; defined( 'WPINC' ) || exit ; class HTML_MIN { /** * @var string */ protected $_html = ''; /** * @var boolean */ protected $_jsCleanComments = true; protected $_skipComments = array(); /** * "Minify" an HTML page * * @param string $html * * @param array $options * * 'cssMinifier' : (optional) callback function to process content of STYLE * elements. * * 'jsMinifier' : (optional) callback function to process content of SCRIPT * elements. Note: the type attribute is ignored. * * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If * unset, minify will sniff for an XHTML doctype. * * @return string */ public static function minify($html, $options = array()) { $min = new self($html, $options); return $min->process(); } /** * Create a minifier object * * @param string $html * * @param array $options * * 'cssMinifier' : (optional) callback function to process content of STYLE * elements. * * 'jsMinifier' : (optional) callback function to process content of SCRIPT * elements. Note: the type attribute is ignored. * * 'jsCleanComments' : (optional) whether to remove HTML comments beginning and end of script block * * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If * unset, minify will sniff for an XHTML doctype. */ public function __construct($html, $options = array()) { $this->_html = str_replace("\r\n", "\n", trim($html)); if (isset($options['xhtml'])) { $this->_isXhtml = (bool)$options['xhtml']; } if (isset($options['cssMinifier'])) { $this->_cssMinifier = $options['cssMinifier']; } if (isset($options['jsMinifier'])) { $this->_jsMinifier = $options['jsMinifier']; } if (isset($options['jsCleanComments'])) { $this->_jsCleanComments = (bool)$options['jsCleanComments']; } if (isset($options['skipComments'])) { $this->_skipComments = $options['skipComments']; } } /** * Minify the markeup given in the constructor * * @return string */ public function process() { if ($this->_isXhtml === null) { $this->_isXhtml = (false !== strpos($this->_html, '_replacementHash = 'MINIFYHTML' . md5($_SERVER['REQUEST_TIME']); $this->_placeholders = array(); // replace SCRIPTs (and minify) with placeholders $this->_html = preg_replace_callback( '/(\\s*)]*?>)([\\s\\S]*?)<\\/script>(\\s*)/i' ,array($this, '_removeScriptCB') ,$this->_html); // replace STYLEs (and minify) with placeholders $this->_html = preg_replace_callback( '/\\s*]*>)([\\s\\S]*?)<\\/style>\\s*/i' ,array($this, '_removeStyleCB') ,$this->_html); // remove HTML comments (not containing IE conditional comments). $this->_html = preg_replace_callback( '//' ,array($this, '_commentCB') ,$this->_html); // replace PREs with placeholders $this->_html = preg_replace_callback('/\\s*]*?>[\\s\\S]*?<\\/pre>)\\s*/i' ,array($this, '_removePreCB') ,$this->_html); // replace TEXTAREAs with placeholders $this->_html = preg_replace_callback( '/\\s*]*?>[\\s\\S]*?<\\/textarea>)\\s*/i' ,array($this, '_removeTextareaCB') ,$this->_html); // trim each line. // @todo take into account attribute values that span multiple lines. $this->_html = preg_replace('/^\\s+|\\s+$/m', '', $this->_html); // remove ws around block/undisplayed elements $this->_html = preg_replace('/\\s+(<\\/?(?:area|article|aside|base(?:font)?|blockquote|body' .'|canvas|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|figcaption|figure|footer|form' .'|frame(?:set)?|h[1-6]|head|header|hgroup|hr|html|legend|li|link|main|map|menu|meta|nav' .'|ol|opt(?:group|ion)|output|p|param|section|t(?:able|body|head|d|h||r|foot|itle)' .'|ul|video)\\b[^>]*>)/i', '$1', $this->_html); // remove ws outside of all elements $this->_html = preg_replace( '/>(\\s(?:\\s*))?([^<]+)(\\s(?:\s*))?$1$2$3<' ,$this->_html); // use newlines before 1st attribute in open tags (to limit line lengths) // $this->_html = preg_replace('/(<[a-z\\-]+)\\s+([^>]+>)/i', "$1\n$2", $this->_html); // fill placeholders $this->_html = str_replace( array_keys($this->_placeholders) ,array_values($this->_placeholders) ,$this->_html ); // issue 229: multi-pass to catch scripts that didn't get replaced in textareas $this->_html = str_replace( array_keys($this->_placeholders) ,array_values($this->_placeholders) ,$this->_html ); return $this->_html; } /** * From LSCWP 6.2: Changed the function to test for special comments that will be skipped. See: https://github.com/litespeedtech/lscache_wp/pull/622 */ protected function _commentCB($m) { // If is IE conditional comment return it. if(0 === strpos($m[1], '[') || false !== strpos($m[1], ' HTML Settings -> HTML Keep comments if(count($this->_skipComments) > 0){ foreach ($this->_skipComments as $comment) { if ($comment && strpos($m[1], $comment) !== false) { return $m[0]; } } } // Comment can be removed. return ''; } protected function _reservePlace($content) { $placeholder = '%' . $this->_replacementHash . count($this->_placeholders) . '%'; $this->_placeholders[$placeholder] = $content; return $placeholder; } protected $_isXhtml = null; protected $_replacementHash = null; protected $_placeholders = array(); protected $_cssMinifier = null; protected $_jsMinifier = null; protected function _removePreCB($m) { return $this->_reservePlace("_reservePlace("\\s*$)/', '', $css); // remove CDATA section markers $css = $this->_removeCdata($css); // minify $minifier = $this->_cssMinifier ? $this->_cssMinifier : 'trim'; $css = call_user_func($minifier, $css); return $this->_reservePlace($this->_needsCdata($css) ? "{$openStyle}/**/" : "{$openStyle}{$css}" ); } protected function _removeScriptCB($m) { $openScript = "_jsCleanComments) { $js = preg_replace('/(?:^\\s*\\s*$)/', '', $js); } // remove CDATA section markers $js = $this->_removeCdata($js); // minify /** * Added 2nd param by LiteSpeed * * @since 2.2.3 */ if ( $this->_jsMinifier ) { $js = call_user_func( $this->_jsMinifier, $js, trim( $m[ 2 ] ) ) ; } else { $js = trim( $js ) ; } return $this->_reservePlace($this->_needsCdata($js) ? "{$ws1}{$openScript}/**/{$ws2}" : "{$ws1}{$openScript}{$js}{$ws2}" ); } protected function _removeCdata($str) { return (false !== strpos($str, ''), '', $str) : $str; } protected function _needsCdata($str) { return ($this->_isXhtml && preg_match('/(?:[<&]|\\-\\-|\\]\\]>)/', $str)); } } चौधर जलाधारमा जलवायु जोखिम न्यूनीकरणको दिशामा स्थानीय पूर्वकार्य प्रणालीको ऐतिहासिक सुरूवात - GLOBAL GORKHA TIMES

चौधर जलाधारमा जलवायु जोखिम न्यूनीकरणको दिशामा स्थानीय पूर्वकार्य प्रणालीको ऐतिहासिक सुरूवात

कञ्चनपुर जलवायु परिवर्तनको बढ्दो चुनौतीहरूसँग जुध्न र स्थानीय समुदायलाई थप सुरक्षित एवम् सक्षम बनाउन कञ्चनपुरको बेदकोट नगरपालिकामा एक ऐतिहासिक कार्यक्रमको शुभारम्भ भएको छ। नेपाल राष्ट्रिय समाज कल्याण संघ (एनएनएसडब्ल्यूए), डीसीए र इन्स्टिट्यूट अफ हिमालयन रिस्क रिडक्सन (आईएचआरआर) लगायता संस्थाहरूको आयोजना तथा नगरपालिकाको समन्वयमा “चौधर जलाधारमा जलवायु उत्थानशीलताका लागि स्थानीय अनुगमन, पूर्वानुमानमा आधारित पूर्वकार्य एवम् प्रविधिका अवयवहरू” नामक एक दिने कार्यशाला गोष्ठी सम्पन्न गरिएको छ। यस पहलले चौधर नदी बेसिन र वरपरका बाढी तथा कटानको उच्च जोखिममा रहेका समुदायहरूका लागि नयाँ आशा जगाएको छ।

कार्यक्रममा नेपाल राष्ट्रिय समाज कल्याण संघ (एनएनएसडब्ल्यूए) सुदृढ परियोजनाका संयोजक राजकुमार सुनारले यस पहलको दूरगामी महत्त्व र यसले स्थानीय समुदायमा पार्ने सकारात्मक प्रभावबारे विस्तृत रूपमा प्रकाश पार्नुभएको थियो। उहाँले जलवायु उत्थानशीलताका लागि स्थानीय क्षमता अभिवृद्धि गर्नुको विकल्प नरहेको औँल्याउनुभयो।

सोही क्रममा डीसीएका व्यवस्थापक दिनेश गुरुङले पनि यस परियोजनामा आफ्नो संस्थाको भूमिका र यसको दीर्घकालीन प्रभावबारे जानकारी गराउँदै सहयोगी संस्थाका रूपमा निरन्तर साथ दिने प्रतिबद्धता व्यक्त गर्नुभयो।

जल तथा मौसम विज्ञान विभागका मौसमविद् बिनु महर्जनले कार्यक्रमको प्राविधिक पक्षलाई सशक्त बनाउँदै प्रभावमा आधारित मौसम पूर्वानुमानको महत्व र मौसम पूर्वानुमान महाशाखाले गर्ने कार्यहरूबारे विस्तृत प्रस्तुति दिनुभएको थियो। उहाँले महाशाखाले जारी गर्ने विभिन्न बुलेटिन, पूर्वसूचना प्रणाली र त्यसको उचित प्रयोगबाट कसरी मानवीय तथा भौतिक क्षति कम गर्न सकिन्छ भन्ने बारेमा सहभागीहरूलाई जानकारी गराउनुभएको थियो। त्यसैगरी प्रभाव तालिका निर्माण र जोखिम सञ्चार वृक्ष निर्माण लगायतका महत्त्वपूर्ण अवधारणामाथि छलफल हुनुले यस परियोजनाको व्यवहारिक पक्षलाई थप बल पुगेको छ।

कार्यक्रममा बेदकोट नगरपालिकाका विपद् सम्पर्क व्यक्ति सुनिल चन्दले गत वर्ष चौधर नदीले पुऱ्याएको क्षतिको विवरण प्रस्तुत गर्नुभएको थियो। उहाँले नदीको तल्लो तटीय क्षेत्रमा बसोबास गर्ने समुदायले हरेक वर्ष भोग्नुपरेको डुबान र कटानको समस्याबारे जानकारी गराउँदै यस्ता कार्यक्रमहरूको अपरिहार्यता माथि जोड दिनुभयो। उहाँले विगतका अनुभवबाट पाठ सिक्दै भविष्यमा आउन सक्ने सम्भाव्य विपद्बाट बच्नका लागि सबै पक्षको सहकार्य आवश्यक रहेको धारणा राख्नुभयो।

बेदकोट नगरपालिकाका नगर प्रवक्ता एवम् बेदकोट नगरपालिका वडा नम्बर ५ का वडा अध्यक्ष चित्र देव भट्टको सभापतित्वमा सम्पन्न कार्यशालामा नगरपालिकाका प्रमुख प्रशासकीय अधिकृत हरि दत्त भट्ट प्रमुख अतिथि रहनुभएको थियो। कार्यक्रमको मूल उद्देश्य जलवायु परिवर्तनका कारण सिर्जित जोखिमहरू, विशेषगरी चौधर नदीमा आउने बाढी र कटानलाई न्यूनीकरण गर्न स्थानीयस्तरमा नै अनुगमन, पूर्वानुमान र पूर्वकार्य प्रणालीको विकास गर्नु रहेको छ। यसका लागि अत्याधुनिक प्रविधिको अधिकतम् प्रयोग गरी समुदायलाई समयमै सचेत गराउने र सम्भावित क्षतिलाई सकेसम्म कम गर्ने रणनीतिमाथि जोड दिइएको छ।

कार्यक्रमको समापनमा बोल्दै बेदकोट नगरपालिकाका प्रमुख प्रशासकीय अधिकृत हरि दत्त भट्टले यस महत्वपूर्ण कार्यक्रमको लागि एनएनएसडब्ल्यूए, डीसीए, आईएचआरआर लगायतका साझेदार संस्थाहरूलाई हार्दिक आभार व्यक्त गर्नुभयो। उहाँले यस परियोजनालाई सफल बनाउन नगरपालिकाको तर्फबाट पूर्ण सहयोग रहने प्रतिबद्धता पनि व्यक्त गर्नुभयो।

चौधर नदी बेसिनमा पर्ने बेदकोट नगरपालिकाका अन्य चार वटा समुदाय र तल्लो तटीय क्षेत्र अन्तर्गत पर्ने बेलडाँडी गाउँपालिकाका बस्तीहरू समेत हरेक वर्ष डुबान र कटानको मारमा पर्ने गरेका छन्। यस परियोजनाले यी सबै जोखिममा रहेका क्षेत्रहरूमा जलवायु उत्थानशीलता अभिवृद्धि गर्न, स्थानीय समुदायलाई सशक्त बनाउन र दिगो विकासको लक्ष्य हासिल गर्न महत्वपूर्ण योगदान पुऱ्याउने विश्वास गरिएको छ। यो पहलले विपद् पूर्वतयारी र प्रतिकार्यमा स्थानीय सरकार, नागरिक समाज र समुदायबीचको समन्वयलाई थप सुदृढ बनाउने अपेक्षा गरिएको छ।

कार्यक्रममा बेदकोट नगरपालिका भित्रका विभिन्न वडाका वडा अध्यक्ष, वडा सदस्य तथा कार्यपालिका सदस्यहरू लगायत एनएनएसडब्ल्यूए, डीसीए, आईएचआरआर र नक्सा प्रालिका प्रतिनिधिहरूको सहभागीता रहेको थियो।

About Surendra Jairu

Check Also

ग्लोवल वार्मिङले पग्लायो लाङटाङ, हिमरेखा सरेपछि पर्यटक घटे

न्यूज एजेन्सी नेपाल, 12 जुन 2025 /  आजभन्दा २० वर्षअघि हिमाली जिल्ला रसुवाको लाङटाङ क्षेत्रका …

Leave a Reply

Your email address will not be published. Required fields are marked *