GenerateHTML() public method

Generates HTML based on current chunk's data Note: this is not a high performance method and if you want ORIGINAL HTML that was parsed to create this chunk then use relevant HTMLparser method to obtain such HTML then you should use function of parser: SetRawHTML
public GenerateHTML ( ) : string
return string
Exemplo n.º 1
0
        /// <summary>
        /// Handles META tags that set page encoding
        /// </summary>
        /// <param name="oChunk">Chunk</param>
        void HandleMetaEncoding(HTMLparser oP, HTMLchunk oChunk, ref bool bEncodingSet)
        {
            // if encoding already set then we should not be trying to set new one
            // this is the logic that major browsers follow - the first Encoding is assumed to be
            // the correct one
            if (bEncodingSet)
            {
                return;
            }

            if (HTMLparser.HandleMetaEncoding(oP, oChunk, ref bEncodingSet))
            {
                if (!bEncodingSet)
                {
                    Console.WriteLine("Failed to set encoding from META: {0}", oChunk.GenerateHTML());
                }
            }
        }
Exemplo n.º 2
0
        private void HandleMetaEncoding( HTMLparser oP, HTMLchunk oChunk, ref bool bEncodingSet )
        {
            // if encoding already set then we should not be trying to set new one
            // this is the logic that major browsers follow - the first Encoding is assumed to be
            // the correct one
            if ( bEncodingSet )
                return;

            if ( HTMLparser.HandleMetaEncoding( oP, oChunk, ref bEncodingSet ) )
            {
                if ( !bEncodingSet )
                    Console.WriteLine( "Failed to set encoding from META: {0}", oChunk.GenerateHTML() );
            }
        }